update the accel path upon parent changes.

Wed Jan  9 15:20:40 2002  Tim Janik  <timj@gtk.org>

        * gtk/gtkmenuitem.c (gtk_menu_item_parent_set): update the accel
        path upon parent changes.
This commit is contained in:
Tim Janik 2002-01-09 14:22:34 +00:00 committed by Tim Janik
parent cdcb272fdf
commit 9b2a1356f0
8 changed files with 55 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Wed Jan 9 15:20:40 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenuitem.c (gtk_menu_item_parent_set): update the accel
path upon parent changes.
Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org> Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org>
* gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important * gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important

View File

@ -1,3 +1,8 @@
Wed Jan 9 15:20:40 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenuitem.c (gtk_menu_item_parent_set): update the accel
path upon parent changes.
Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org> Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org>
* gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important * gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important

View File

@ -1,3 +1,8 @@
Wed Jan 9 15:20:40 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenuitem.c (gtk_menu_item_parent_set): update the accel
path upon parent changes.
Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org> Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org>
* gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important * gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important

View File

@ -1,3 +1,8 @@
Wed Jan 9 15:20:40 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenuitem.c (gtk_menu_item_parent_set): update the accel
path upon parent changes.
Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org> Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org>
* gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important * gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important

View File

@ -1,3 +1,8 @@
Wed Jan 9 15:20:40 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenuitem.c (gtk_menu_item_parent_set): update the accel
path upon parent changes.
Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org> Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org>
* gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important * gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important

View File

@ -1,3 +1,8 @@
Wed Jan 9 15:20:40 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenuitem.c (gtk_menu_item_parent_set): update the accel
path upon parent changes.
Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org> Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org>
* gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important * gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important

View File

@ -1,3 +1,8 @@
Wed Jan 9 15:20:40 2002 Tim Janik <timj@gtk.org>
* gtk/gtkmenuitem.c (gtk_menu_item_parent_set): update the accel
path upon parent changes.
Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org> Wed Jan 9 13:20:14 2002 Tim Janik <timj@gtk.org>
* gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important * gtk/gtkviewport.c (gtk_viewport_size_allocate): small but important

View File

@ -67,6 +67,8 @@ static void gtk_menu_item_paint (GtkWidget *widget,
GdkRectangle *area); GdkRectangle *area);
static gint gtk_menu_item_expose (GtkWidget *widget, static gint gtk_menu_item_expose (GtkWidget *widget,
GdkEventExpose *event); GdkEventExpose *event);
static void gtk_menu_item_parent_set (GtkWidget *widget,
GtkWidget *previous_parent);
static void gtk_real_menu_item_select (GtkItem *item); static void gtk_real_menu_item_select (GtkItem *item);
@ -151,6 +153,7 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
widget_class->show_all = gtk_menu_item_show_all; widget_class->show_all = gtk_menu_item_show_all;
widget_class->hide_all = gtk_menu_item_hide_all; widget_class->hide_all = gtk_menu_item_hide_all;
widget_class->mnemonic_activate = gtk_menu_item_mnemonic_activate; widget_class->mnemonic_activate = gtk_menu_item_mnemonic_activate;
widget_class->parent_set = gtk_menu_item_parent_set;
container_class->forall = gtk_menu_item_forall; container_class->forall = gtk_menu_item_forall;
@ -1013,6 +1016,23 @@ gtk_menu_item_accel_name_foreach (GtkWidget *widget,
} }
} }
static void
gtk_menu_item_parent_set (GtkWidget *widget,
GtkWidget *previous_parent)
{
GtkMenuItem *menu_item = GTK_MENU_ITEM (widget);
GtkMenu *menu = GTK_IS_MENU (widget->parent) ? GTK_MENU (widget->parent) : NULL;
if (menu)
_gtk_menu_item_refresh_accel_path (menu_item,
menu->accel_path,
menu->accel_group,
TRUE);
if (GTK_WIDGET_CLASS (parent_class)->parent_set)
GTK_WIDGET_CLASS (parent_class)->parent_set (widget, previous_parent);
}
void void
_gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item, _gtk_menu_item_refresh_accel_path (GtkMenuItem *menu_item,
const gchar *prefix, const gchar *prefix,