X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b1ff57f1ee08eb970520de784816c4115bd84f0..fae763d0883dbc84142ee272b7d1bb1fe04f354b:/src/gtk/choice.cpp diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 97eb8e1203..54f9b1de42 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -122,12 +122,8 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, m_parent->DoAddChild( this ); - PostCreation(); - InheritAttributes(); - - SetBestSize(size); - - Show( TRUE ); + PostCreation(size); + SetBestSize(size); // need this too because this is a wxControlWithItems return TRUE; } @@ -564,7 +560,11 @@ wxSize wxChoice::DoGetBestSize() const if ( ret.x < 80 ) ret.x = 80; - ret.y = 16 + GetCharHeight(); + // If this request_size is called with no entries then + // the returned height is wrong. Give it a reasonable + // default value. + if (ret.y <= 18) + ret.y = 8 + GetCharHeight(); return ret; } @@ -578,6 +578,13 @@ bool wxChoice::IsOwnGtkWindow( GdkWindow *window ) #endif } +// static +wxVisualAttributes +wxChoice::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) +{ + return GetDefaultAttributesFromGTKWidget(gtk_option_menu_new); +} + #endif // wxUSE_CHOICE