- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
-
- Append( item, (char*)NULL );
-}
-
-void wxComboBox::Append( const wxString &item, char *clientData )
-{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
-
- GtkWidget *list = GTK_COMBO(m_widget)->list;
-
- GtkWidget *list_item = gtk_list_item_new_with_label( item );
-
- gtk_signal_connect( GTK_OBJECT(list_item), "select",
- GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
-
- m_clientData.Append( (wxObject*)clientData );
-
- gtk_container_add( GTK_CONTAINER(list), list_item );
-
- if (m_widgetStyle) ApplyWidgetStyle();
-
- gtk_widget_show( list_item );
+ m_clientDataList.Append( (wxObject*) clientData );
+ m_clientObjectList.Append( (wxObject*)NULL );
+
+ AppendCommon( item );
+}
+
+void wxComboBox::Append( const wxString &item, wxClientData *clientData )
+{
+ m_clientDataList.Append( (wxObject*) NULL );
+ m_clientObjectList.Append( (wxObject*) clientData );
+
+ AppendCommon( item );
+}
+
+void wxComboBox::SetClientData( int n, void* clientData )
+{
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+
+ wxNode *node = m_clientDataList.Nth( n );
+ if (!node) return;
+
+ node->SetData( (wxObject*) clientData );
+}
+
+void* wxComboBox::GetClientData( int n )
+{
+ wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
+
+ wxNode *node = m_clientDataList.Nth( n );
+ if (!node) return NULL;
+
+ return node->Data();
+}
+
+void wxComboBox::SetClientObject( int n, wxClientData* clientData )
+{
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+
+ wxNode *node = m_clientObjectList.Nth( n );
+ if (!node) return;
+
+ wxClientData *cd = (wxClientData*) node->Data();
+ if (cd) delete cd;
+
+ node->SetData( (wxObject*) clientData );
+}
+
+wxClientData* wxComboBox::GetClientObject( int n )
+{
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") );
+
+ wxNode *node = m_clientDataList.Nth( n );
+ if (!node) return (wxClientData*) NULL;
+
+ return (wxClientData*) node->Data();
+}
+
+void wxComboBox::Clear()
+{
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+
+ GtkWidget *list = GTK_COMBO(m_widget)->list;
+ gtk_list_clear_items( GTK_LIST(list), 0, Number() );
+
+ wxNode *node = m_clientObjectList.First();
+ while (node)
+ {
+ wxClientData *cd = (wxClientData*)node->Data();
+ if (cd) delete cd;
+ node = node->Next();
+ }
+ m_clientObjectList.Clear();
+
+ m_clientDataList.Clear();