diff options
author | Michael Meeks <michael@ximian.com> | 2004-02-20 18:02:21 +0000 |
---|---|---|
committer | Michael Meeks <michael@src.gnome.org> | 2004-02-20 18:02:21 +0000 |
commit | ecb4df1307fd5fc6c3d40267f676a74c6d242677 (patch) | |
tree | 219af071ccc4ceba7d8d06e5df25bf7eb7f94119 /gtk/gtktoolitem.c | |
parent | c19aa6739db259860c53aacb07a8104debcffebc (diff) | |
download | gtk+-ecb4df1307fd5fc6c3d40267f676a74c6d242677.tar.gz |
impl. (gtk_tool_item_class_init): hook it up.
2004-02-20 Michael Meeks <michael@ximian.com>
* gtk/gtktoolitem.c (gtk_tool_item_property_notify): impl.
(gtk_tool_item_class_init): hook it up.
(gtk_tool_item_set_proxy_menu_item): synchronize sensitivity.
* gtk/gtktoolbutton.c (gtk_tool_button_property_notify):
chain to parent, fix strcmp bug.
Diffstat (limited to 'gtk/gtktoolitem.c')
-rw-r--r-- | gtk/gtktoolitem.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c index 8969adf7eb..42c79cccf4 100644 --- a/gtk/gtktoolitem.c +++ b/gtk/gtktoolitem.c @@ -76,6 +76,8 @@ static void gtk_tool_item_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gtk_tool_item_property_notify (GObject *object, + GParamSpec *pspec); static void gtk_tool_item_realize (GtkWidget *widget); static void gtk_tool_item_unrealize (GtkWidget *widget); static void gtk_tool_item_map (GtkWidget *widget); @@ -136,6 +138,7 @@ gtk_tool_item_class_init (GtkToolItemClass *klass) object_class->set_property = gtk_tool_item_set_property; object_class->get_property = gtk_tool_item_get_property; object_class->finalize = gtk_tool_item_finalize; + object_class->notify = gtk_tool_item_property_notify; widget_class->realize = gtk_tool_item_realize; widget_class->unrealize = gtk_tool_item_unrealize; @@ -338,6 +341,17 @@ gtk_tool_item_get_property (GObject *object, } static void +gtk_tool_item_property_notify (GObject *object, + GParamSpec *pspec) +{ + GtkToolItem *tool_item = GTK_TOOL_ITEM (object); + + if (tool_item->priv->menu_item && strcmp (pspec->name, "sensitive") == 0) + gtk_widget_set_sensitive (tool_item->priv->menu_item, + GTK_WIDGET_SENSITIVE (tool_item)); +} + +static void create_drag_window (GtkToolItem *toolitem) { GtkWidget *widget; @@ -1059,6 +1073,9 @@ gtk_tool_item_set_proxy_menu_item (GtkToolItem *tool_item, { g_object_ref (menu_item); gtk_object_sink (GTK_OBJECT (menu_item)); + + gtk_widget_set_sensitive (menu_item, + GTK_WIDGET_SENSITIVE (tool_item)); } tool_item->priv->menu_item = menu_item; |