1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| class RightPanel(wx.Panel):
def __init__(self, parent):
super().__init__(parent, size=(200, 500))
#self.SetBackgroundColour("green")
rightpanel = wx.Panel(self, -1, size = (200, 1000),style = wx.BORDER_SUNKEN)
choices = dict(Infrarouge=('IR038','IR087','IR097','IR103',),Visible=('VIS04','VIS05','VIS06','VIS08',),
Simulation=('SIMT39','SIMT52','SIMT111',),)
def onSelectCombobox(evt):
selection = evt.GetString()
print('Sélection combobox :', selection)
lst = choices[selection]
combobox2.SetValue('')
combobox2.SetItems(lst)
def onSelectCombobox2(evt) :
selection = evt.GetString()
print('Sélection combobox2 :', selection)
combobox = wx.ComboBox(rightpanel, choices=lst(choices))
combobox2 = wx.ComboBox(rightpanel)
combobox_sizer = wx.BoxSizer(wx.HORIZONTAL)
combobox_sizer.Add(combobox)
combobox_sizer.Add(combobox2)
pan2.SetSizer(combobox_sizer)
combobox.Bind(wx.EVT_COMBOBOX, onSelectCombobox)
combobox2.Bind(wx.EVT_COMBOBOX, onSelectCombobox2) |
Partager