Search code examples
pythonwxwidgets

wxCheckListBox update choices


How to update/change the choice list of a wxCheckListBox on the fly? IN the reference http://docs.wxwidgets.org/3.0/classwx_check_list_box.html#a7ef1af0cad44ed9b4ab99daa3469e10b I just can set this on the constructor.


Solution

  • wx.CheckListBox() is variant of (inherits) wx.ListBox(), therefore you can see the docs for wx.ListBox() and use data manipulation methods from there.

    To add/delete items on the fly you would use:

    lb = wx.CheckListBox(self, ...)
    # Methods:
    lb.Append()
    lb.Insert()
    lb.Delete()
    

    And there are more. As I said, go and dig through docs for wx.ListBox().