I want to get the selection of several wxChoice boxes. But i do not want to have to catch the events for all the boxes I should be able to access the current selection outside of an event,but i am not seeing how to do this.
This is a hack of the wxpython choice demo to demonstrate my question #--------- comment marks are for indention #import wx #class TestChoice(wx.Dialog): # def __init__(self, parent): # #self.log = log # wx.Dialog.__init__(self, parent, -1) # # sampleList = ['zero', 'one', 'two', 'three', 'four', 'five', # 'six', 'seven', 'eight'] # # wx.StaticText(self, -1, "This example uses the wxChoice control.", (15, 10)) # wx.StaticText(self, -1, "Select one:", (15, 50), (75, -1)) # self.ch = wx.Choice(self, -1, (100, 50), choices = sampleList) # self.Bind(wx.EVT_CHOICE, self.EvtChoice, self.ch) # # # def EvtChoice(self, event): # print('EvtChoice: %s\n' % event.GetString()) # self.ch.Append("A new item") # ##-----changed here --------- from event.GetSelection() # if self.ch.GetSelection() == 'one': # print('Well done!\n') # # #if __name__ == "__main__": # app = wx.PySimpleApp(0) # wx.InitAllImageHandlers() # Dialog_Main = TestChoice(None) # app.SetTopWindow(Dialog_Main) # Dialog_Main.Show() # app.MainLoop() -- http://mail.python.org/mailman/listinfo/python-list