Hi all,
The title says it all; my app (Siren) uses hierarchical menus extensively (see the attached screen shot for an example), and I'd rather not have them be many-click menus as in Squeak. Is there an implementation of true hierarchical/pull-right menus in Squeak or any of its descendants (I'm using Cuis). stp <http://forum.world.st/file/t9553/h-menu.jpg> -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html |
On 2020-05-31, at 2:49 PM, Stephen Pope <[hidden email]> wrote: That's a DockingBarMenuMorph but it's just a child of MenuMorph. I think one simply uses #add:subMenu: Oddly enough I was talking to some other folk about Siren just last week... tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Useful random insult:- Kept an open mind -- and his brains fell out. |
Hi Stephen. Sub-menus will behave as expected. :-) To create something like what Tim showed, you can use this interface: MenuMorph >> #add:subMenu: If you want to write menu-construction code that should (eventually) work in Squeak's Morphic and MVC, you should use this interface: MenuMorph >> #add:subMenu:target:selector:argumentList: CustomMenu >> #add:subMenu:target:selector:argumentList: If you are using ToolBuilder directly to construct menus (i.e. PluggableMenuSpec), there is -- unfortunately -- no way to add sub-menus. However, almost all tools that go through ToolBuilder construct their menus via a callback from the actual widgets (e.g., PluggableListMorph in Morphic, PluggableListView in MVC), which then arrives as "someMenu" in your model's menu-construction method. That "someMenu" will then be a MenuMorph (in Morphic) or CustomMenu (in MVC). See above for that case. :-) That latter, most frequent way, to construct menus does not add sub-menus but this .... very special ;-) ... "more..." menu item at the end of the list. Best, Marcel
|
> On 2020-05-31, at 11:53 PM, Marcel Taeumel <[hidden email]> wrote: > > If you are using ToolBuilder directly to construct menus (i.e. PluggableMenuSpec), there is -- unfortunately -- no way to add sub-menus. However, almost all tools that go through ToolBuilder construct their menus via a callback from the actual widgets (e.g., PluggableListMorph in Morphic, PluggableListView in MVC), which then arrives as "someMenu" in your model's menu-construction method. That "someMenu" will then be a MenuMorph (in Morphic) or CustomMenu (in MVC). See above for that case. :-) On my list of things to attack one day is cleaning up the horrendous mess of menu building via toolbuilder. Maybe by the time I get to it somebody else will have solved it for me. > > That latter, most frequent way, to construct menus does not add sub-menus but this .... very special ;-) ... "more..." menu item at the end of the list. ... which is possibly the nastiest way one could do it. If you have to have menus with more than ~9 items, a well thought out hierarchical menu is the least awful approach. If you arrange for it to work well then it is possible to make even complex hierarchies seem natural; see for example, how RISC OS does the job. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim C for sinking, java for drinking, Smalltalk for thinking |
> On my list of things to attack one day is cleaning up the horrendous mess of menu building via toolbuilder. Maybe by the time I get to it somebody else will have solved it for me. I'm currently working at a new PluggableMenuButtonMorph where I am dealing with similar design decisions in the ToolBuilder. Let's exchange some ideas before we start reinventing the same wheel from different sides. :-)
Von: Squeak-dev <[hidden email]> im Auftrag von tim Rowledge <[hidden email]>
Gesendet: Montag, 1. Juni 2020 20:04:16 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] Is there a pull-right hierarchical menu in Squeak? > On 2020-05-31, at 11:53 PM, Marcel Taeumel <[hidden email]> wrote: > > If you are using ToolBuilder directly to construct menus (i.e. PluggableMenuSpec), there is -- unfortunately -- no way to add sub-menus. However, almost all tools that go through ToolBuilder construct their menus via a callback from the actual widgets (e.g., PluggableListMorph in Morphic, PluggableListView in MVC), which then arrives as "someMenu" in your model's menu-construction method. That "someMenu" will then be a MenuMorph (in Morphic) or CustomMenu (in MVC). See above for that case. :-) On my list of things to attack one day is cleaning up the horrendous mess of menu building via toolbuilder. Maybe by the time I get to it somebody else will have solved it for me. > > That latter, most frequent way, to construct menus does not add sub-menus but this .... very special ;-) ... "more..." menu item at the end of the list. ... which is possibly the nastiest way one could do it. If you have to have menus with more than ~9 items, a well thought out hierarchical menu is the least awful approach. If you arrange for it to work well then it is possible to make even complex hierarchies seem natural; see for example, how RISC OS does the job. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim C for sinking, java for drinking, Smalltalk for thinking
Carpe Squeak!
|
Free forum by Nabble | Edit this page |