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.
Method Summary |
|
__init__(self)
|
|
__repr__(self)
|
int |
Append (self,
item,
clientData)
Adds the item to the control, associating the given data with the item
if not None. |
|
AppendItems (self,
strings)
Apend several items at once to the control. |
|
Clear (self)
Removes all items from the control. |
|
Delete (self,
n)
Deletes the item at the zero-based index 'n' from the control. |
int |
FindString (self,
s)
Finds an item whose label matches the given string. |
PyObject |
GetClientData (self,
n)
Returns the client data associated with the given item, (if any.) |
int |
GetCount (self)
Returns the number of items in the control. |
int |
GetSelection (self)
Returns the index of the selected item or wx.NOT_FOUND if no item
is selected. |
String |
GetString (self,
n)
Returns the label of the item with the given index. |
wxArrayString |
GetStrings(self)
|
String |
GetStringSelection (self)
Returns the label of the selected item or an empty string if no item
is selected. |
int |
Insert (self,
item,
pos,
clientData)
Insert an item into the control before the item at the pos index,
optionally associating some data object with the item. |
bool |
IsEmpty (self)
Returns True if the control is empty or False if it has some items. |
|
Select (self,
n)
This is the same as SetSelection and exists only because it is
slightly more natural for controls which support multiple selection. |
|
SetClientData (self,
n,
clientData)
Associate the given client data with the item at position n. |
|
SetSelection (self,
n)
Sets the item at index 'n' to be the selected item. |
|
SetString (self,
n,
s)
Sets the label for the given item. |
bool |
SetStringSelection(self,
s)
|