[Q] MenuMorph add:subMenu: trouble

Ned Konz ned at bike-nomad.com
Sat Jul 22 23:12:23 UTC 2000


Aaron Thieme wrote:

> ... I get an error when the menu is instantiated (not when it's being
> created!).  Digging showed the problem to be that the MenuItemMorph titled
> 'sub...' has no arguments;  there's an iterating block context (over the
> items in the main menu) in something like "instantiateInView" that assumes
> that "item arguments" will return a collection.  In my case, for whatever
> reason, arguments is nil and I get an error.

I dunno.. this works for me from a Workspace. Does it work for you?

 mainMenu _ MenuMorph new defaultTarget: self.
 subMenu := MenuMorph new.
 subMenu add: 'foo' action: #inspect.
 mainMenu addLine.
 mainMenu add: 'sub...' subMenu: subMenu.
 mainMenu openInWorld.


-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com





More information about the Squeak-dev mailing list