[..join(['fred','dixon'] wrote: > 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.
> # 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') Perhaps you are confused by the fact that GetSelection() returns an integer? Changing the above to either if self.ch.GetStringSelection() == 'one': print 'Well done!' or if self.ch.GetSelection() == 1: print 'Well done, too!' should work as you expect then. Peter -- http://mail.python.org/mailman/listinfo/python-list