]> git.saurik.com Git - wxWidgets.git/commitdiff
GTK+ selects the first item initially
authorRobert Roebling <robert@roebling.de>
Wed, 19 Sep 2007 13:48:39 +0000 (13:48 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 19 Sep 2007 13:48:39 +0000 (13:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/choice.cpp

index fbe064f3e0d249d37b02cef7c4eb4391d9014d45..b63c3c68bc760e9289ca7377472850a4bb7e36ca 100644 (file)
@@ -110,8 +110,8 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
         m_strings = new wxSortedArrayString;
     }
 
-    // begin with no selection
-    m_selection_hack = wxNOT_FOUND;
+    // If we have items, GTK will choose the first item by default
+    m_selection_hack = n > 0 ? 0 : wxNOT_FOUND;
 
     GtkWidget *menu = gtk_menu_new();