From 9f53ea911b06ba53348fdee479e630ae3d51b737 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 19 Sep 2007 13:48:25 +0000 Subject: [PATCH] GTK+ selects the first item initially git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/choice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 8de9414838..bcce43a4d1 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -118,8 +118,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();