9 def action_open(value
):
10 print 'gui.action_open',"Scheduled to be deprecated."
11 value
.setdefault('x',None)
12 value
.setdefault('y',None)
13 value
['container'].open(value
['window'],value
['x'],value
['y'])
15 def action_setvalue(value
):
16 print 'gui.action_setvalue',"Scheduled to be deprecated."
20 def action_quit(value
):
21 print 'gui.action_quit',"Scheduled to be deprecated."
24 def action_exec(value
):
25 print 'gui.action_exec',"Scheduled to be deprecated."
26 exec(value
['script'],globals(),value
['dict'])
28 class Toolbox(table
.Table
):
29 def __setattr__(self
,k
,v
):
30 _v
= self
.__dict
__.get(k
,NOATTR
)
32 if k
== 'value' and _v
!= NOATTR
and _v
!= v
:
34 for w
in self
.group
.widgets
:
35 if w
.value
!= v
: w
.pcls
= ""
39 def _change(self
,value
):
40 self
.value
= self
.group
.value
43 def __init__(self
,data
,cols
=0,rows
=0,tool_cls
='tool',value
=None,**params
):
44 print 'gui.Toolbox','Scheduled to be deprecated.'
45 params
.setdefault('cls','toolbox')
46 table
.Table
.__init
__(self
,**params
)
48 if cols
== 0 and rows
== 0: cols
= len(data
)
49 if cols
!= 0 and rows
!= 0: rows
= 0
57 g
.connect(CHANGE
,self
._change
,None)
58 self
.group
.value
= _value
61 for ico
,value
in data
:
62 #from __init__ import theme
63 img
= pguglobals
.app
.theme
.get(tool_cls
+"."+ico
,"","image")
66 else: i
= basic
.Label(ico
,cls
=tool_cls
+".label")
67 p
= button
.Tool(g
,i
,value
,cls
=tool_cls
)
74 if cols
!= 0 and x
== cols
: x
,y
= 0,y
+1
76 if rows
!= 0 and y
== rows
: x
,y
= x
+1,0