Community
Participate
Working Groups
Hi, I am adding and removing Accelerators to MenuItems. To remove an accelerator I call "menuItem.setAccelerator(-1)". This works on Windows, but on Linux I am getting GTK Errors telling me that an error has occured while setting the accelerators. Here is the error message that appears in the console on my Suse Linux 9.0: (<unknown>:1968): Gtk-CRITICAL **: file gtkaccelgroup.c: line 497 (gtk_accel_group_connect): assertion `accel_key > 0' failed Ben
Forgott to tell: I am using Suse Linux 9 with SWT 3.0 M7.
It would be very usefull if MenuItem had a method "removeAccelerator" or "destroyAccelerator" or a notice how to remove the accelerator in the JavaDoc comment of "setAccelerator".
Moving to SN because I don't see a documented way to remove an accelerator. This needs either new api or additional documentation on setAccelerator (and implementation on at least gtk of course).
To remove accelerator call setAccelarator(0). We should document this and may throw exception if value is negative.
SSQ, don't throw an exception. Just fail silently (no accelerator will be fired because -1 does not match any accelerator patter). I believe that this is what we do on the other platforms. GTK treats the value as signed but the others do not. Make sure that we are consistent across platforms. Thanks.
MenuItem#setAccelerator() not yet mentioning in JavaDoc how to remove an accelerator. Ben
Still an issue in latest Integration Build. Easy to fix with updating JavaDoc though :)
Fixed > 20050425. JavaDoc was changed to mention that zero is the default value (and indicates that the menu item does not have an accelarator). GTK warnings have been fixed as well.