wx._core.ItemContainer
The wx.ItemContainer class defines an interface which is implemented
by all controls which have string subitems, each of which may be
selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
as `wx.ComboBox` which implements an extended interface deriving from
this one.
It defines the methods for accessing the control's items and although
each of the derived classes implements them differently, they still
all conform to the same interface.
The items in a wx.ItemContainer have (non empty) string labels and,
optionally, client data associated with them.
Append(args, kwargs)
Append(self, String item, PyObject clientData=None) -> int
Adds the item to the control, associating the given data with the item
if not None. The return value is the index of the newly added item
which may be different from the last one if the control is sorted (e.g.
has wx.LB_SORT or wx.CB_SORT style).
AppendItems(args, kwargs)
AppendItems(self, List strings)
Apend several items at once to the control. Notice that calling this
method may be much faster than appending the items one by one if you
need to add a lot of items.
Clear(args, kwargs)
Clear(self)
Removes all items from the control.
Delete(args, kwargs)
Delete(self, int n)
Deletes the item at the zero-based index 'n' from the control. Note
that it is an error (signalled by a `wx.PyAssertionError` exception if
enabled) to remove an item with the index negative or greater or equal
than the number of items in the control.
FindString(args, kwargs)
FindString(self, String s) -> int
Finds an item whose label matches the given string. Returns the
zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
found.
GetClientData(args, kwargs)
GetClientData(self, int n) -> PyObject
Returns the client data associated with the given item, (if any.)
GetCount(args, kwargs)
GetCount(self) -> int
Returns the number of items in the control.
GetSelection(args, kwargs)
GetSelection(self) -> int
Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
is selected.
GetString(args, kwargs)
GetString(self, int n) -> String
Returns the label of the item with the given index.
GetStringSelection(args, kwargs)
GetStringSelection(self) -> String
Returns the label of the selected item or an empty string if no item
is selected.
GetStrings(args, kwargs)
GetStrings(self) -> wxArrayString
Insert(args, kwargs)
Insert(self, String item, int pos, PyObject clientData=None) -> int
Insert an item into the control before the item at the ``pos`` index,
optionally associating some data object with the item.
IsEmpty(args, kwargs)
IsEmpty(self) -> bool
Returns True if the control is empty or False if it has some items.
Select(args, kwargs)
Select(self, int n)
This is the same as `SetSelection` and exists only because it is
slightly more natural for controls which support multiple selection.
SetClientData(args, kwargs)
SetClientData(self, int n, PyObject clientData)
Associate the given client data with the item at position n.
SetSelection(args, kwargs)
SetSelection(self, int n)
Sets the item at index 'n' to be the selected item.
SetString(args, kwargs)
SetString(self, int n, String s)
Sets the label for the given item.
SetStringSelection(args, kwargs)
SetStringSelection(self, String s) -> bool
[constructor]
Usage: classname(arguments)
[member '__dict__']
The dictionary of attributes and methods for this class
[member '__doc__']
Documentation for this class
[member '__module__']
The module that this class belongs to
[member '__weakref__']
No Documentation
[operator 'repr']
Usage: repr(a)