- gtk_signal_connect( GTK_OBJECT(list_item), "select",
- GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
- }
-
- PostCreation();
-
-/*
- gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
- GTK_SIGNAL_FUNC(gtk_combo_size_callback), (gpointer)this );
-*/
-
- if (!value.IsNull()) SetValue( value );
+ m_focusWidget = combo->entry;
+
+ PostCreation();
+
+ ConnectWidget( combo->button );
+
+ // MSW's combo box shows the value and the selection is -1
+ gtk_entry_set_text( GTK_ENTRY(combo->entry), wxGTK_CONV(value) );
+ gtk_list_unselect_all( GTK_LIST(combo->list) );
+
+ if (style & wxCB_READONLY)
+ gtk_entry_set_editable( GTK_ENTRY( combo->entry ), FALSE );
+
+ gtk_signal_connect( GTK_OBJECT(combo->entry), "changed",
+ GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this );
+
+ gtk_signal_connect( GTK_OBJECT(combo->list), "select-child",
+ GTK_SIGNAL_FUNC(gtk_combo_select_child_callback), (gpointer)this );
+
+ wxSize size_best( DoGetBestSize() );
+ wxSize new_size( size );
+ if (new_size.x == -1)
+ new_size.x = size_best.x;
+ if (new_size.y == -1)
+ new_size.y = size_best.y;
+ if (new_size.y > size_best.y)
+ new_size.y = size_best.y;
+ if ((new_size.x != size.x) || (new_size.y != size.y))
+ {
+ SetSize( new_size.x, new_size.y );
+
+ // This is required for tool bar support
+ gtk_widget_set_usize( m_widget, new_size.x, new_size.y );
+ }
+
+ SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
+ SetForegroundColour( parent->GetForegroundColour() );
+
+ Show( TRUE );
+
+ return TRUE;
+}
+
+wxComboBox::~wxComboBox()
+{
+ wxNode *node = m_clientObjectList.GetFirst();
+ while (node)
+ {
+ wxClientData *cd = (wxClientData*)node->GetData();
+ if (cd) delete cd;
+ node = node->GetNext();
+ }
+ m_clientObjectList.Clear();
+
+ m_clientDataList.Clear();
+}
+
+void wxComboBox::SetFocus()
+{
+ if ( m_hasFocus )
+ {
+ // don't do anything if we already have focus
+ return;
+ }
+
+ gtk_widget_grab_focus( m_focusWidget );
+}
+
+void wxComboBox::AppendCommon( const wxString &item )
+{
+ wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
+
+ DisableEvents();