]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/choice.cpp
compilation fix for wxUSE_DISPLAY==0
[wxWidgets.git] / src / gtk / choice.cpp
index b63c3c68bc760e9289ca7377472850a4bb7e36ca..294d977377c157750095dff326789bbf5b1bec9b 100644 (file)
@@ -62,7 +62,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *
     else if ( choice->HasClientUntypedData() )
         event.SetClientData( choice->GetClientData(n) );
 
-    choice->GetEventHandler()->ProcessEvent(event);
+    choice->HandleWindowEvent(event);
 }
 }
 
@@ -163,6 +163,12 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items,
         m_selection_hack += count;
     }
 
+    // We must set the selection so that it can be read back even if 
+    // the user has not modified it since GTK+ will then select the
+    // first item so well return 0.
+    if ((count > 0) && (m_selection_hack==wxNOT_FOUND))
+        m_selection_hack = 0;
+
     return pos - 1;
 }