From 9ddf4854dfbb07c7ef0b85b1c5550ed5d4956235 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 5 Dec 2004 16:56:56 +0000 Subject: [PATCH] Invalidate the best size after adding an item to a wxChoice. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/choice.cpp | 9 +++++++++ src/gtk1/choice.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 4bef419b40..c0b20e406b 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -513,7 +513,16 @@ int wxChoice::GtkAddHelper(GtkWidget *menu, int pos, const wxString& item) ApplyWidgetStyle(); } + else + // The best size of a wxChoice should probably + // be changed everytime the control has been + // changed, but at least after adding an item + // it has to change. Adapted from Matt Ownby. + InvalidateBestSize(); + + gtk_signal_connect( GTK_OBJECT( menu_item ), "activate", + GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this ); gtk_signal_connect( GTK_OBJECT( menu_item ), "activate", GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this ); diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index 4bef419b40..c0b20e406b 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -513,7 +513,16 @@ int wxChoice::GtkAddHelper(GtkWidget *menu, int pos, const wxString& item) ApplyWidgetStyle(); } + else + // The best size of a wxChoice should probably + // be changed everytime the control has been + // changed, but at least after adding an item + // it has to change. Adapted from Matt Ownby. + InvalidateBestSize(); + + gtk_signal_connect( GTK_OBJECT( menu_item ), "activate", + GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this ); gtk_signal_connect( GTK_OBJECT( menu_item ), "activate", GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this ); -- 2.45.2