It defines the methods for accessing the controls 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. Client data may be of two different kinds: either simple untyped ( void ) pointers which are simply stored by the control but not used in any way by it, or typed pointers (wxClientData) which are owned by the control meaning that the typed client data (and only it) will be deleted when an item is deleted using Delete or the entire control is cleared using Clear, which also happens when it is destroyed.

Finally note that in the same control all items must have client data of the same type (typed or untyped), if any. This type is determined by the first call to Append (the version with client data pointer) or SetClientData.

Associates the given typed client data pointer with the given item: the data object will be deleted when the item is deleted (either explicitly by using Delete or implicitly when the control itself is destroyed).

The client data associated with the item will be also deleted if it is owned by the control. Note that it is an error (signalled by an assert failure in debug builds) to remove an item with the index negative or greater or equal than the number of items in the control.

Returns the client object associated with the given item and transfers its ownership to the caller.

This method, unlike GetClientObject , expects the caller to delete the returned pointer. It also replaces the internally stored pointer with None, i.e. completely detaches the client object pointer from the control.

Returns a pointer to the client data associated with the given item (if any).

It is an error to call this function for a control which doesn’t have typed client data at all although it is wx.OK to call it even if the given item doesn’t have any client data associated with it (but other items do).

Notice that the returned pointer is still owned by the control and will be deleted by it, use DetachClientObject if you want to remove the pointer from the control.

Associates the given typed client data pointer with the given item: the data object will be deleted when the item is deleted (either explicitly by using Delete or implicitly when the control itself is destroyed).

Note that it is an error to call this function if any untyped client data pointers had been associated with the control items before.