Can I combine a checkbox and a list box

You can combine a checkbox with a list box using the class wx.CheckListBox. Figure 7.14 displays a checkbox and a list box together.

The constructor and most methods of wx.Check-ListBox are identical to wx.ListBox. There is one new event, wx.evt_checklistbox, which is triggered when one of the checkboxes in the list is clicked. There are two new methods for managing the checkboxes:

I | one

1 two

I | three


□ four

□ fi»e

□ six

1 1 eiaht


Figure 7.14 A check list box is very similar to a regular list box

Check(n, check) sets the check state of the item at index n, and IsChecked(item) returns True if the item at the given index is checked.

Was this article helpful?

0 0

Post a comment