[Q] MenuMorph add:subMenu: trouble

Jon Hylands Jon at huv.com
Sun Jul 23 00:38:38 UTC 2000


On Sat, 22 Jul 2000 15:50:16 -0700 (PDT), Aaron Thieme <ghede at well.com>
wrote:

> I patched this by changing MenuItemMorph to passively initialize
> arguments to an empty collection if it's nil, but haven't been able to
> figure out why the normal old system menus/submenus -- which apparently
> construct submenus exactly as I am doing -- don't encounter this problem.

I had the same problem when I did the sub menus with PIC/Smalltalk, so I
fixed that method like this:

add: aString subMenu: aMenuMorph
	"Append the given submenu with the given label."

	| item |
	item _ MenuItemMorph new.
	item contents: aString;
		subMenu: aMenuMorph;
		arguments: #().
	self addMorphBack: item.

-------

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com





More information about the Squeak-dev mailing list