diff options
author | Benjamin Otte <otte@redhat.com> | 2011-07-06 18:43:07 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-07-06 18:47:00 +0200 |
commit | 552113131cedf405d2e935bf9e163539a2f30856 (patch) | |
tree | c62421bb828db4d880a9655b9edd1358c254c90e /gtk/gtkcheckmenuitem.c | |
parent | 70b8f8f7efa049ec98092e08c0ef53a50aa52c14 (diff) | |
download | gtk+-552113131cedf405d2e935bf9e163539a2f30856.tar.gz |
menuitems: Use submenuitem accessible exclusively
Submenus can come and go, so we cannot use an accessible that doesn't
allow for that.
Also, this fixes a rather large refleak.
Diffstat (limited to 'gtk/gtkcheckmenuitem.c')
-rw-r--r-- | gtk/gtkcheckmenuitem.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c index 27465f5039..66c078fb19 100644 --- a/gtk/gtkcheckmenuitem.c +++ b/gtk/gtkcheckmenuitem.c @@ -103,24 +103,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_IT G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE, gtk_check_menu_item_activatable_interface_init)) -static AtkObject * -gtk_check_menu_item_get_accessible (GtkWidget *widget) -{ - GObject *object; - AtkObject *accessible; - - /* FIXME this is not really right, submenus can come and go */ - if (gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget))) - object = g_object_new (GTK_TYPE_CHECK_SUBMENU_ITEM_ACCESSIBLE, NULL); - else - object = g_object_new (GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, NULL); - - accessible = ATK_OBJECT (object); - atk_object_initialize (accessible, widget); - - return accessible; -} - static void gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass) { @@ -169,7 +151,8 @@ gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass) GTK_PARAM_READABLE)); widget_class->draw = gtk_check_menu_item_draw; - widget_class->get_accessible = gtk_check_menu_item_get_accessible; + + gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_CHECK_SUBMENU_ITEM_ACCESSIBLE); menu_item_class->activate = gtk_check_menu_item_activate; menu_item_class->hide_on_activate = FALSE; |