setting label doesn't clear accelerator



Here's a Bonobo UI bug I ran into, but found a workaround for:

In an XML file, I had menus defined with underscore accelerators in their
labels (e.g., "_File"). Using Alt-F thus makes that menu appear.

Due to the way the inheritance is set up, the Nautilus desktop window starts
out as a normal window but hides the menu bar before it appears. This does
not prevent the Alt-F from popping up the menu, though there is some GTK
complaint about it not being on screen even as it appears on screen.

My first crack at working around this was to reset the label on the menu to
not have the underscore character. This was in place and working with the
old BonoboUIHandler; setting the label of an existing menu to an
underscore-free string would reset the underscore accelerator correctly such
that Alt-<char> would no longer cause the menu to appear.

When this code got updated for the new Bonobo UI stuff, the old fix stopped
working. Setting the label of the menu item via bonobo_ui_component_set_prop
did not change its already-established accelerator. E.g., I would set the
label, originally "_File", to "File", but Alt-F would continue to cause the
menu to appear on screen.

This seems to be a bug in the Bonobo code that processes the new menu label.
It should remove any existing label-defined accelerator when setting the new
label.

I found a workaround for it though, so I don't actually need this bug fixed
in Bonobo for Nautilus's sake. The workaround is to redefine the label in
the xml file for the desktop window component -- doing so in this place does
correctly prevent the old Alt-<key> accelerators from working.

John





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]