Changeset - 43aa1ee8b3a9
[Not reviewed]
default
0 2 0
drewp - 22 years ago 2002-07-07 06:43:40

some comments and garbage cleanup
2 files changed with 16 insertions and 6 deletions:
0 comments (0 inline, 0 general)
light8/rsn.py
Show inline comments
 
@@ -40,12 +40,13 @@ io.init(DUMMY)
 
channel_levels = []
 
scalelevels = {}
 
fades = {}
 

	
 
_oldlevels=[None] * 68
 

	
 
# this is called on a loop, and ALSO by the Scales
 
def changelevel(*args):
 
    'Amp trims slider'
 
    global _oldlevels
 

	
 
    levels = [0] * 68
 
    for name, s in Subs.subs.items():
 
@@ -84,14 +85,12 @@ def quit(*args):
 
    root.destroy()
 
    sys.exit()
 

	
 

	
 
xfader=Xfader(scalelevels)
 

	
 

	
 

	
 
def buildinterface(*args):
 
    global channel_levels, _oldlevels, leveldisplay, xfader
 
    for w in root.winfo_children():
 
        w.destroy()
 

	
 
    stage_tl=toplevelat(165,90)
 
@@ -188,10 +187,6 @@ bindkeys(root,'<Escape>', quit)
 

	
 
# bindkeys(root,'<q>', quit)
 
# bindkeys(root,'<r>', refresh)
 
# bindkeys(root,'<s>', make_sub)
 
backgroundloop()
 
root.mainloop() # Receiver switches main
 

	
 
while 1:
 
    for lev in range(0,255,25)+range(255,0,-25):
 
        sleep(.2)
light8/stage.py
Show inline comments
 
@@ -28,12 +28,26 @@ class Stage(Canvas):
 
    a light can be selected on its location point, its aim point
 
    (which may or may not be present), or its name.
 

	
 
    lights should be able to be interactively 'locked', which blocks
 
    them from being selected. 
 

	
 
    API:
 
      __init__(parent,**kw)
 
        put pass any canvas options you want
 
        
 
      setimage(stageimage)
 
        sets image to given filename (ppm, gif, etc) and resizes the canvas to the image size
 

	
 
      addlight(name, location, aim=None)
 
        location and aim are pixel coord tuples. name will be passed back to you in the callback (see below)
 

	
 
      setlightchangecb(cb)
 
        give a function which will be called like this: cb(list_of_light_names, delta)
 
      
 

	
 
    """
 
    def __init__(self,parent,**kw):
 
        Canvas.__init__(self,parent,**kw)
 

	
 
        self.bind("<ButtonPress-1>", self.leftpress)
 
        self.bind("<B1-Motion>", self.leftmotion)
 
@@ -127,12 +141,13 @@ class Stage(Canvas):
 
                    self.clearselection()
 
                    self.select(touching[0])
 
                    # and adjust its level
 
                    self.lmbstate='levelchange'
 
                    
 
            else:
 
                # clicked a light that wasn't selected
 
                if not shifted:
 
                    self.clearselection()
 
                self.select(touching[0])
 
                # and adjust levels now
 
                self.lmbstate='levelchange'
 
                
0 comments (0 inline, 0 general)