Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wxPython: refresh and update combobox

I got a wxPython combobox which contains a list of sections of my .ini file. I add new section while my program is running. And I also want to see the NEW entries in my combobox.

How can I refresh / update it?

My code :

self.cbxCfgProfiles = wx.ComboBox(self, pos=(170, 120), size=(440, -1),   
                                  choices=getCfgProfileList(), style=wx.CB_DROPDOWN)

When I restart my program I see the new entries.

I try already self.cbxCfgProfiles.Refresh() in my method. It does not work. :(

like image 895
hashyH0 Avatar asked Jun 23 '26 21:06

hashyH0


1 Answers

If you have a new list of strings that you want to set the combobox to, the SetItems() method is probably the easiest way. It clears the control and then adds all the new selections.

like image 160
Mike Driscoll Avatar answered Jun 26 '26 11:06

Mike Driscoll