diff options
author | Sven Herzberg <sven@imendio.com> | 2008-02-08 00:25:50 +0000 |
---|---|---|
committer | Sven Herzberg <herzi@src.gnome.org> | 2008-02-08 00:25:50 +0000 |
commit | c12d7baeca0d1d21fbfe141a49ce09c23f75d57e (patch) | |
tree | e67c0fa28112f50529d54a97392cc8fb9e61df27 /gtk/gtkaction.c | |
parent | d9519a59a96c278d34ed7b9bd9313263189963fc (diff) | |
download | gtk+-c12d7baeca0d1d21fbfe141a49ce09c23f75d57e.tar.gz |
Adjust the code to match the documentation, examples, "common sense" and
2008-02-08 Sven Herzberg <sven@imendio.com>
Adjust the code to match the documentation, examples, "common sense"
and existing applications.
* gtk/gtkaction.c: (_gtk_action_sync_menu_visible): take into account
that a GtkMenu for a <popup> element doesn't have to have a GtkAction
assigned
svn path=/trunk/; revision=19497
Diffstat (limited to 'gtk/gtkaction.c')
-rw-r--r-- | gtk/gtkaction.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c index ce966e0476..14485a6c03 100644 --- a/gtk/gtkaction.c +++ b/gtk/gtkaction.c @@ -637,7 +637,8 @@ _gtk_action_sync_menu_visible (GtkAction *action, GtkWidget *proxy, gboolean empty) { - gboolean visible, hide_if_empty; + gboolean visible = TRUE; + gboolean hide_if_empty = TRUE; g_return_if_fail (GTK_IS_MENU_ITEM (proxy)); g_return_if_fail (action == NULL || GTK_IS_ACTION (action)); @@ -645,8 +646,12 @@ _gtk_action_sync_menu_visible (GtkAction *action, if (action == NULL) action = g_object_get_qdata (G_OBJECT (proxy), quark_gtk_action_proxy); - visible = gtk_action_is_visible (action); - hide_if_empty = action->private_data->hide_if_empty; + if (action) + { + /* a GtkMenu for a <popup/> doesn't have to have an action */ + visible = gtk_action_is_visible (action); + hide_if_empty = action->private_data->hide_if_empty; + } if (visible && !(empty && hide_if_empty)) gtk_widget_show (proxy); |