[squeak-dev] Is there a pull-right hierarchical menu in Squeak?

Marcel Taeumel marcel.taeumel at hpi.de
Mon Jun 1 06:53:27 UTC 2020

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.

Am 01.06.2020 00:25:54 schrieb tim Rowledge <tim at rowledge.org>:

On 2020-05-31, at 2:49 PM, Stephen Pope <stephen at heaveneverywhere.com [mailto:stephen at heaveneverywhere.com]> wrote:

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).

You mean like this - 

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 Rowledge; tim at rowledge.org [mailto:tim at rowledge.org]; http://www.rowledge.org/tim [http://www.rowledge.org/tim]
Useful random insult:- Kept an open mind -- and his brains fell out.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200601/166eac48/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2020-05-31 at 3.21.42 PM.png
Type: image/png
Size: 106951 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200601/166eac48/attachment-0001.png>

More information about the Squeak-dev mailing list