GNOME Bugzilla – Bug 84241
gtk_menu_item_set_accel_path() should accept accel_path=NULL
Last modified: 2011-02-04 16:11:17 UTC
The gtk_menu_item_set_accel_path() function should allow you to unset the accel path by passing accel_path=NULL. The gtk_widget_set_accel_path() function can unset the accel path by passing NULL, so I think this one should too. It looks like it is only the assertion that is preventing it from working. I would change the following assertion: g_return_if_fail (accel_path && accel_path[0] == '<' && strchr (accel_path, '/')); to: g_return_if_fail (accel_path == NULL || (accel_path[0] == '<' && strchr (accel_path, '/'))); I ran into this with my menu merge code, where I sometimes want to disassociate a menu item widget with the action it was proxying for. Part of the disconnection process is unsetting the accel path, so that it doesn't share the accelerator with other widgets that are still proxying for the action.
I'm OK with the change for the HEAD branch; see: http://mail.gnome.org/archives/gtk-devel-list/2002-June/msg00101.html for comments baout applying this change stable; I think it really is an API addition.
Mon Sep 23 18:45:46 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkmenuitem.c (gtk_menu_item_set_accel_path): Allow accel_path == NULL. (#84241, James Henstridge.) Change Committed. Testing that accel_path == NULL actually works now would be appreciated.