pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

How to get top level menu item shortcuts to work?

TM
Tim Mackinnon
Thu, Apr 1, 2021 10:19 AM

Hi - I tried asking this on Discord, but it got lost in the day to day stuff - so trying here.

I am a bit confused how Keyboard shortcuts work in P8 for World menus.  I have a method with the <worldMenu> pragma, and I get aBuilder, and I create a top level menu item. Then to add a child, it seems that I just create a new #item: and set its #parent: to the new id I've created (all good), and then I set #keyText: 'r, o'  and while it shows a menu item with CMD-RO in its text, the keystroke doesn't seem to work. I've tried different options even, 'o, x' but none of them trigger - so I must be missing something? Anyone know?

My code looks like this (menuId = #Paradise - the top level menu item I have created)

| menuId |

(aBuilder item: (menuId := #Paradise))
order: 4.0;
target: self;
help: 'Tools to support Code Paradise projects'.

(aBuilder item: #'Reload...')
parent: menuId;
help: 'Clear the session for a web application, and reload its''s page';
order: 15;
keyText: 'r, r';
icon: (self iconNamed: #smallUpdate);
action: [ self resetSession ].

Hi - I tried asking this on Discord, but it got lost in the day to day stuff - so trying here. I am a bit confused how Keyboard shortcuts work in P8 for World menus. I have a method with the <worldMenu> pragma, and I get aBuilder, and I create a top level menu item. Then to add a child, it seems that I just create a new #item: and set its #parent: to the new id I've created (all good), and then I set #keyText: 'r, o' and while it shows a menu item with CMD-RO in its text, the keystroke doesn't seem to work. I've tried different options even, 'o, x' but none of them trigger - so I must be missing something? Anyone know? My code looks like this (menuId = #Paradise - the top level menu item I have created) | menuId | (aBuilder item: (menuId := #Paradise)) order: 4.0; target: self; help: 'Tools to support Code Paradise projects'. (aBuilder item: #'Reload...') parent: menuId; help: 'Clear the session for a web application, and reload its''s page'; order: 15; keyText: 'r, r'; icon: (self iconNamed: #smallUpdate); action: [ self resetSession ].