-void* wxComboBox::GetClientData( int n )
-{
- wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" );
-
- wxNode *node = m_clientDataList.Nth( n );
- if (!node) return NULL;
-
- return node->Data();
+ if ( entry )
+ m_focusWidget = GTK_WIDGET( entry );
+
+ PostCreation(size);
+
+ if ( entry )
+ {
+ if (style & wxCB_READONLY)
+ {
+ // this will assert and do nothing if the value is not in our list
+ // of strings which is the desired behaviour (for consistency with
+ // wxMSW and also because it doesn't make sense to have a string
+ // which is not a possible choice in a read-only combobox)
+ SetStringSelection(value);
+ gtk_editable_set_editable(GTK_EDITABLE(entry), false);
+ }
+ else // editable combobox
+ {
+ // any value is accepted, even if it's not in our list
+ gtk_entry_set_text( entry, wxGTK_CONV(value) );
+ }
+
+ g_signal_connect_after (entry, "changed",
+ G_CALLBACK (gtkcombobox_text_changed_callback), this);
+ }
+
+ g_signal_connect_after (m_widget, "changed",
+ G_CALLBACK (gtkcombobox_changed_callback), this);
+
+ if ( !gtk_check_version(2,10,0) )
+ {
+ g_signal_connect (m_widget, "notify::popup-shown",
+ G_CALLBACK (gtkcombobox_popupshown_callback), this);
+ }
+
+ SetInitialSize(size); // need this too because this is a wxControlWithItems
+
+ return true;