- GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
- GtkWidget *menu_item;
- menu_item = gtk_menu_item_new_with_label( item );
- gtk_signal_connect( GTK_OBJECT( menu_item ), "activate",
- GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
- gtk_menu_append( GTK_MENU(menu), menu_item );
- gtk_widget_show( menu_item );
+ m_clientDataList.Append( (wxObject*) NULL );
+ m_clientObjectList.Append( (wxObject*) NULL );
+
+ AppendCommon( item );
+}
+
+void wxChoice::Append( const wxString &item, void *clientData )
+{
+ m_clientDataList.Append( (wxObject*) clientData );
+ m_clientObjectList.Append( (wxObject*) NULL );
+
+ AppendCommon( item );
+}
+
+void wxChoice::Append( const wxString &item, wxClientData *clientData )
+{
+ m_clientObjectList.Append( (wxObject*) clientData );
+ m_clientDataList.Append( (wxObject*) NULL );
+
+ AppendCommon( item );
+}
+
+void wxChoice::SetClientData( int n, void* clientData )
+{
+ wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+
+ wxNode *node = m_clientDataList.Nth( n );
+ if (!node) return;
+
+ node->SetData( (wxObject*) clientData );
+}
+
+void* wxChoice::GetClientData( int n )
+{
+ wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" );
+
+ wxNode *node = m_clientDataList.Nth( n );
+ if (!node) return NULL;
+
+ return node->Data();
+}
+
+void wxChoice::SetClientObject( int n, wxClientData* clientData )
+{
+ wxCHECK_RET( m_widget != NULL, "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* wxChoice::GetClientObject( int n )
+{
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, "invalid combobox" );
+
+ wxNode *node = m_clientObjectList.Nth( n );
+ if (!node) return (wxClientData*) NULL;
+
+ return (wxClientData*) node->Data();