Mercurial > code > home > repos > light9
comparison flax/dmxchanedit.py @ 205:3905d3c92aaa
twisted mainloop, more row-change keys, xmlrpc fadesub command on port 8050
author | drewp |
---|---|
date | Sun, 10 Apr 2005 15:03:24 +0000 |
parents | e4a711d9a338 |
children |
comparison
equal
deleted
inserted
replaced
204:186a66095036 | 205:3905d3c92aaa |
---|---|
10 sys.path.append("../light8") | 10 sys.path.append("../light8") |
11 import Patch | 11 import Patch |
12 from uihelpers import make_frame, colorlabel, eventtoparent | 12 from uihelpers import make_frame, colorlabel, eventtoparent |
13 from dispatch import dispatcher | 13 from dispatch import dispatcher |
14 | 14 |
15 stdfont = ('Arial', 10) | 15 stdfont = ('Arial', 12) |
16 | 16 |
17 class Onelevel(tk.Frame): | 17 class Onelevel(tk.Frame): |
18 """a name/level pair""" | 18 """a name/level pair""" |
19 def __init__(self, parent, channelnum): | 19 def __init__(self, parent, channelnum): |
20 """channelnum is 1..68, like the real dmx""" | 20 """channelnum is 1..68, like the real dmx""" |
51 def setupmousebindings(self): | 51 def setupmousebindings(self): |
52 def b1down(ev): | 52 def b1down(ev): |
53 self.desc_lab.config(bg='cyan') | 53 self.desc_lab.config(bg='cyan') |
54 self._start_y=ev.y | 54 self._start_y=ev.y |
55 self._start_lev=self.currentlevel | 55 self._start_lev=self.currentlevel |
56 # self.bind("<ButtonPress-1>",b1down) | |
57 def b1motion(ev): | 56 def b1motion(ev): |
58 delta=self._start_y-ev.y | 57 delta=self._start_y-ev.y |
59 self.changelevel(self._start_lev+delta*.005) | 58 self.changelevel(self._start_lev+delta*.005) |
60 # self.bind("<B1-Motion>",b1motion) | |
61 def b1up(ev): | 59 def b1up(ev): |
62 self.desc_lab.config(bg='black') | 60 self.desc_lab.config(bg='black') |
63 # self.bind("<B1-ButtonRelease>",b1up) | 61 def b3up(ev): |
62 self.changelevel(0.0) | |
63 def b3down(ev): | |
64 self.changelevel(1.0) | |
64 | 65 |
65 # make the buttons work in the child windows | 66 # make the buttons work in the child windows |
66 for w in self.winfo_children(): | 67 for w in self.winfo_children(): |
67 for e,func in (('<ButtonPress-1>',b1down), | 68 for e,func in (('<ButtonPress-1>',b1down), |
68 ('<B1-Motion>',b1motion), | 69 ('<B1-Motion>',b1motion), |
69 ('<ButtonRelease-1>',b1up)): | 70 ('<ButtonRelease-1>',b1up), |
71 ('<ButtonRelease-3>', b3up), | |
72 ('<ButtonPress-3>', b3down)): | |
70 w.bind(e,func) | 73 w.bind(e,func) |
71 # w.bind(e,lambda ev,e=e: eventtoparent(ev,e)) | 74 # w.bind(e,lambda ev,e=e: eventtoparent(ev,e)) |
72 | 75 |
73 def colorlabel(self): | 76 def colorlabel(self): |
74 """color the level label based on its own text (which is 0..100)""" | 77 """color the level label based on its own text (which is 0..100)""" |