This is rather trivial but I got stuck. I simplified my program to
just show problem.
I basically want to get the value of spinner. However with such code
···
############################
import wx
class MyMainClass(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,'My window',size=(400,400))
panel = wx.Panel(self)
spiner = wx.SpinCtrl(panel,1,'spinner',(40,40), (90,-1))
spiner.SetRange(1,100)
spiner.SetValue(10)
wx.EVT_SPINCTRL(self, 1, self.OnChange)
def OnChange(self, event):
a = event.GetValue()
print a
if __name__=='__main__':
app = wx.PySimpleApp()
frame = MyMainClass(parent=None,id=-1)
frame.Show()
app.MainLoop()
###########################
I get error
line 19, in OnChange
a = event.GetValue()
AttributeError: 'CommandEvent' object has no attribute 'GetValue'
while here it clearly states that spinctrl has GetValue!
http://docs.wxwidgets.org/stable/wx_wxspinctrl.html#wxspinctrlgetvalue
where is my mistake? How should it look like to return the value of
spinner?