- 论坛徽章:
- 0
|
- #coding:gb2312
- import wx
- class SliderFrame(wx.Frame):
- def __init__(self):
- wx.Frame.__init__(self,None,-1,"滑块例子",size=(300,350))
- panel=wx.Panel(self,-1)
- self.count=0
-
- slider=wx.Slider(panel,100,25,1,100,
- pos=(10,10),
- size=(250,-1),
- style=wx.SL_HORIZONTAL|wx.SL_AUTOTICKS|wx.SL_LABELS)
- slider.SetTickFreq(5,1)
- print slider.GetValue()
- silder=wx.Slider(panel,100,0,-1,1,
- pos=(125,70),
- size=(-1,250),
- style=wx.SL_VERTICAL|wx.SL_AUTOTICKS|wx.SL_LABELS)
- slider.SetTickFreq(20,1)
-
- if __name__=='__main__':
- app=wx.PySimpleApp()
- frame=SliderFrame()
- frame.Show()
- app.MainLoop()
-
-
-
复制代码
问题:
如何让我的滑块,滑动 范围是(-1.0,1.0),让它滑动一次是0.1,
这个怎么实现呢?? |
|