Forum > LCL

TMainMenu issue - gtk2?

(1/2) > >>

GordonFindlay:
I seem to recall an issue earlier with TMainmenu hotkeys and gtk2.  Is this perhaps a manifestation of it?

With a main menu on a form, I set the caption of one menu item as &Jump. In the menu editor the J is underlined - as expected.

But at run time, the J is not underlined, and  Alt-J does not trigger the Jump.

The TMainmenu.Shortcutkey property can be set to Alt+J - although that's not in the dropdown list associated with the property in the object inspector.
And it works. But extends the caption to be 'Jump   Alt+J'.

Is the &Jump hotkey construction supposed to work, in Lazarus 3.2, FPC 3.2.2  using gtk2 widget set, running on XFCE?

AlexTP:
Alt+J will work for '&Jump' if '&Jump' is the root menu item, ie not the subitem.

GordonFindlay:
Oh.  I didn't see that documented anywhere, and I am using the shortcut for a submenu.

Bother.

petevick:
the '&Jump' and Alt+J shortcut are two separate things. To see the '&Jump' underline at run time you have to hold down the Alt key which will show underlines at the top level, so say you have '&Edit' as a top menu, Alt+E will open that menu up, and all sub menu items will show underlines, but if '&Jump' is a sub menu item you'll just press J to activate. The Alt+J shortcut should work at anytime, although I've always used Ctrl+ for sub menu item shortcuts.

teresa:

--- Quote from: petevick on May 15, 2024, 10:24:53 am --- The Alt+J shortcut should work at anytime, although I've always used Ctrl+ for sub menu item shortcuts.

--- End quote ---
Maybe, but the Object Inspector drop-down doesn't include ALT-key in the list of possibilities for submenu items.

Navigation

[0] Message Index

[#] Next page

Go to full version