def __init__(self, master, fromValue=0.0, to=1.0, command=None, **kw): if kw.has_key("orient"): if kw["orient"] == "vertical": stl = wx.SB_VERTICAL else: stl = wx.SB_HORIZONTAL RangedSlider.__init__(self, master, -1, 1024, style=stl) self.setRange(0, 100, fromValue, to) self.Bind(wx.EVT_SCROLL, self.handle) self.oldval = -0xdeadbeef self.set((fromValue + to) * 0.5) self.command = command #self.event_add("<<Update>>","<ButtonRelease>") self.redraw()
def __init__(self, master, updateCallback): RangedSlider.__init__(self, master, -1, 200, size=(300, -1)) self.setRange(0, 100, 0.0, 2.0) self.Bind(wx.EVT_SCROLL, self.handler) light = None self.updateCallback = updateCallback