From: Vadim Zeitlin Date: Tue, 6 Apr 2010 18:46:09 +0000 (+0000) Subject: Set the value passed to wxComboBox ctor in wxOSX/Cocoa. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f25cb0af6bad7390e3d29ba9dc58815ea5115d41 Set the value passed to wxComboBox ctor in wxOSX/Cocoa. The initial value was simply ignored, do use it now if it's specified, i.e. non empty. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/combobox_osx.cpp b/src/osx/combobox_osx.cpp index 22ae6a9256..744ad7304a 100644 --- a/src/osx/combobox_osx.cpp +++ b/src/osx/combobox_osx.cpp @@ -72,8 +72,10 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, Append(n, choices); - // Set the first item as being selected - if (n > 0) + // Set up the initial value, by default the first item is selected. + if ( !value.empty() ) + SetValue(value); + else if (n > 0) SetSelection( 0 ); // Needed because it is a wxControlWithItems