After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 84241 - gtk_menu_item_set_accel_path() should accept accel_path=NULL
gtk_menu_item_set_accel_path() should accept accel_path=NULL
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-06-05 14:02 UTC by James Henstridge
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.0



Description James Henstridge 2002-06-05 14:02:32 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.
Comment 1 Owen Taylor 2002-06-12 19:22:04 UTC
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.
Comment 2 Owen Taylor 2002-09-23 22:48:39 UTC
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.