wxPoint(45, 10))
wxStaticText(self, -1, "Select one:", wxPoint(15, 50), wxSize(65, 18))
- lb = wxListBox(self, 60, wxPoint(80, 50), wxSize(80, 120),
+ self.lb1 = wxListBox(self, 60, wxPoint(80, 50), wxSize(80, 120),
sampleList, wxLB_SINGLE)
EVT_LISTBOX(self, 60, self.EvtListBox)
EVT_LISTBOX_DCLICK(self, 60, self.EvtListBoxDClick)
- lb.SetSelection(0)
+ EVT_RIGHT_UP(self.lb1, self.EvtRightButton)
+ self.lb1.SetSelection(0)
wxStaticText(self, -1, "Select many:", wxPoint(200, 50), wxSize(65, 18))
- self.lb = wxListBox(self, 70, wxPoint(280, 50), wxSize(80, 120),
+ self.lb2 = wxListBox(self, 70, wxPoint(280, 50), wxSize(80, 120),
sampleList, wxLB_EXTENDED)
EVT_LISTBOX(self, 70, self.EvtMultiListBox)
EVT_LISTBOX_DCLICK(self, 70, self.EvtListBoxDClick)
- self.lb.SetSelection(0)
+ self.lb2.SetSelection(0)
def EvtListBox(self, event):
self.log.WriteText('EvtListBox: %s\n' % event.GetString())
def EvtListBoxDClick(self, event):
- self.log.WriteText('EvtListBoxDClick:\n')
+ self.log.WriteText('EvtListBoxDClick: %s\n' % self.lb1.GetSelection())
def EvtMultiListBox(self, event):
- self.log.WriteText('EvtMultiListBox: %s\n' % str(self.lb.GetSelections()))
+ self.log.WriteText('EvtMultiListBox: %s\n' % str(self.lb2.GetSelections()))
+ def EvtRightButton(self, event):
+ self.log.WriteText('EvtRightButton: %s\n' % event.GetPosition())
#---------------------------------------------------------------------------