[Cuis-dev] Decentralized menu definition

Hilaire Fernandes hfern at free.fr
Wed Jul 20 07:11:51 PDT 2022


Hi Juan,


Le 19/07/2022 à 16:15, Juan Vuletich a écrit :
>
> This is interesting. But if we are to change how menus are built in 
> the base image, adding a mechanism that packages will depend on, I'd 
> like it to also address these:
> - Keyboard shortcuts. Today, these are even in a worse shape than 
> menus. There's no way to tweak them, and we already ran out of them.

In term of object responsibilities, is menu responsible to represent 
keyboard short cut? Or put it in another way, does a keyboard shortcut 
can exist outside of a menu? I think so. Menu definition can use an 
existing framework to declare a keyboard short cut and represent it in 
its label, however I don't see how it could be responsible for the 
implementation. Related but not responsible.

As a comparison, Menu use extensively Label (LabelMorph), but you will 
not say Menu should be responsible of Label.

Nevertheless, I understand the interest to address the keyboard 
shortcuts situation you mentioned. I never look at the implementation. 
Happy to help though.


> - Context. Different gui controls in different apps will need 
> different menus / shortcuts. Even depending on state or mode.
> - Scope of context. Some menus / shortcuts may apply to a leaf morph, 
> like a text editor or list. Others apply to a window or other 
> composite morph. Others are global.

I don't understand. Is it not orthogonal to any way of declaring a menu  ?

myMorph>someMenus: builder
<myMorphMenu>
(self myContext is: A) ifTrue: [builder menu defintionA].

(self myContext is: B) ifTrue: [builder menu defintionB].

builder menu generalDef


>
> Actually, we are talking about user commands and how to issue them. 
> So, some questions are:
> - which user commands are available on a certain morph in a certain moment

Which object should be responsible to decide that. The morph itself, or 
the context this morph is used : its owner? The model of the surrounding 
application? Or the entire image?


> - how do we group them in menus
> - how (if) we assign them a keyboard shortcut
>
> Everyone, please chime in and share your ideas or possible approaches. 
> It would be great if we can find a general solution.

-- 
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220720/4f170724/attachment.htm>


More information about the Cuis-dev mailing list