Changeset - c76b62eccdec
[Not reviewed]
default
0 1 0
dmcc - 22 years ago 2002-07-07 06:18:40

put **kw back in, they now go to the scale and can override the defaults.
put **kw back in, they now go to the scale and can override the defaults.
for our purposes, we probably want to edit the defaults so we don't have
them in every call.
1 file changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
Widgets/FlyingFader.py
Show inline comments
 
from Tkinter import *
 
from time import time
 

	
 
class FlyingFader(Frame):
 
    def __init__(self, master, variable, label, time=1.5, font=('Arial', 8)):
 
    def __init__(self, master, variable, label, time=1.5, font=('Arial', 8),
 
                 **kw):
 
        Frame.__init__(self, master)
 
        self.name = label
 
        self.variable = variable
 
        self.fadelength = time
 
        self.curfade = None
 
        self.fadetimes = 0, 0
 

	
 
        self.config({'bd':1, 'relief':'raised'})
 
        self.scale = Scale(self, variable=variable, showvalue=0, from_=100, 
 
            to_=0, res=0.1, width=20, length=200)
 
        scaleopts = {'variable' : variable, 'showvalue' : 0, 'from' : 100,
 
                     'to' : 0, 'res' : 0.1, 'width' : 20, 'length' : 200}
 
        scaleopts.update(kw)
 
        
 
        self.scale = Scale(self, scaleopts)
 
        self.vlabel = Label(self, text="0.0", font=font)
 
        self.label = Label(self, text=label, wraplength=40, font=font)
 

	
 
        self.oldtrough = self.scale['troughcolor']
 

	
 
        self.scale.pack(side=TOP, expand=1, fill=BOTH, anchor='c')
0 comments (0 inline, 0 general)