summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-04-14 13:53:57 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-04-14 13:53:57 +0000
commit5dc40ee3b447902c7d2078b08775314d1eb869a1 (patch)
tree561dd90f695dd652710a3951115eb746f85f6fad /gtk
parent11eaf5a97cd5182900917f127ebc7ead9d1fd9c7 (diff)
downloadgtk+-5dc40ee3b447902c7d2078b08775314d1eb869a1.tar.gz
Don't spit out warnings if called before the combo box is realized.
2004-04-14 Matthias Clasen <mclasen@redhat.com> * gtk/gtkcombobox.c (gtk_combo_box_relayout): Don't spit out warnings if called before the combo box is realized. (#139742, Philip Langdale)
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkcombobox.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 79942ee42c..759d5a089e 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1872,22 +1872,20 @@ gtk_combo_box_relayout (GtkComboBox *combo_box)
GList *list, *j;
GtkWidget *menu;
- /* do nothing unless we are in menu style */
- if (combo_box->priv->tree_view)
- return;
-
menu = combo_box->priv->popup_widget;
-
+
+ /* do nothing unless we are in menu style and realized */
+ if (combo_box->priv->tree_view || !GTK_IS_MENU_SHELL (menu))
+ return;
+
/* get rid of all children */
- g_return_if_fail (GTK_IS_MENU_SHELL (menu));
-
list = gtk_container_get_children (GTK_CONTAINER (menu));
-
+
for (j = g_list_last (list); j; j = j->prev)
gtk_container_remove (GTK_CONTAINER (menu), j->data);
-
+
g_list_free (list);
-
+
/* and relayout */
gtk_combo_box_menu_fill (combo_box);
}