gtk+ r19498 - in branches/gtk-2-12: . gtk
- From: herzi svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r19498 - in branches/gtk-2-12: . gtk
- Date: Fri, 8 Feb 2008 00:29:20 +0000 (GMT)
Author: herzi
Date: Fri Feb 8 00:29:20 2008
New Revision: 19498
URL: http://svn.gnome.org/viewvc/gtk+?rev=19498&view=rev
Log:
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
Modified:
branches/gtk-2-12/ChangeLog
branches/gtk-2-12/gtk/gtkaction.c
Modified: branches/gtk-2-12/gtk/gtkaction.c
==============================================================================
--- branches/gtk-2-12/gtk/gtkaction.c (original)
+++ branches/gtk-2-12/gtk/gtkaction.c Fri Feb 8 00:29:20 2008
@@ -637,7 +637,8 @@
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 @@
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]