comparison light8/uihelpers.py @ 102:e04f7b552bcd

- scroll wheel works everywhere - scroll wheel works everywhere - interface is white on black - subs that start scenes are white - more status information, startup process kinda cleaned up
author dmcc
date Sun, 14 Jul 2002 08:01:24 +0000
parents a995fd1a8f03
children 4136e92829e3
comparison
equal deleted inserted replaced
101:a995fd1a8f03 102:e04f7b552bcd
14 'stage' : '823x683+37+030', 14 'stage' : '823x683+37+030',
15 'scenes' : '504x198+462+12', 15 'scenes' : '504x198+462+12',
16 } 16 }
17 17
18 def make_frame(parent): 18 def make_frame(parent):
19 f = Frame(parent, bd=0) 19 f = Frame(parent, bd=0, bg='black')
20 f.pack(side='left') 20 f.pack(side='left')
21 return f 21 return f
22 22
23 def bindkeys(root,key, func): 23 def bindkeys(root,key, func):
24 root.bind(key, func) 24 root.bind(key, func)
73 if not k.startswith('__'): 73 if not k.startswith('__'):
74 print k,getattr(ev,k) 74 print k,getattr(ev,k)
75 print "" 75 print ""
76 76
77 def eventtoparent(ev,sequence): 77 def eventtoparent(ev,sequence):
78 "passes an event to the parent" 78 "passes an event to the parent, screws up TixComboBoxes"
79
80 wid_class = str(ev.widget.__class__)
81 if wid_class == 'Tix.ComboBox' or wid_class == 'Tix.TixSubWidget':
82 return
83
79 evdict={} 84 evdict={}
80 for x in ['state', 'time', 'y', 'x', 'serial']: 85 for x in ['state', 'time', 'y', 'x', 'serial']:
81 evdict[x]=getattr(ev,x) 86 evdict[x]=getattr(ev,x)
82 # evdict['button']=ev.num 87 # evdict['button']=ev.num
83 par=ev.widget.winfo_parent() 88 par=ev.widget.winfo_parent()
206 #self._tk.call("trace","vdelete",self._name,'w',cbname) 211 #self._tk.call("trace","vdelete",self._name,'w',cbname)
207 print "FancyDoubleVar: successfully deleted trace named %s" % name 212 print "FancyDoubleVar: successfully deleted trace named %s" % name
208 else: 213 else:
209 print "FancyDoubleVar: attempted to delete named %s which wasn't set to any function" % name 214 print "FancyDoubleVar: attempted to delete named %s which wasn't set to any function" % name
210 215
211 216 def get_selection(listbox):
212 217 'Given a listbox, returns first selection as integer'
218 selection = int(listbox.curselection()[0]) # blech
219 return selection
213 220
214 if __name__=='__main__': 221 if __name__=='__main__':
215 root=Tk() 222 root=Tk()
216 root.tk_focusFollowsMouse() 223 root.tk_focusFollowsMouse()
217 iv=IntVar() 224 iv=IntVar()
219 print "cb!" 226 print "cb!"
220 t = Togglebutton(root,text="testbutton",command=cb,variable=iv) 227 t = Togglebutton(root,text="testbutton",command=cb,variable=iv)
221 t.pack() 228 t.pack()
222 Entry(root,textvariable=iv).pack() 229 Entry(root,textvariable=iv).pack()
223 root.mainloop() 230 root.mainloop()
224
225
226
227
228
229
230
231
232