[Q] What is the right context for this?

Ned Konz ned at bike-nomad.com
Fri Mar 21 19:37:17 UTC 2003


On Friday 21 March 2003 11:01 am, David Faught wrote:

> The "Utilities evaluate:" fails because when the answer string is
> evaluated, it has no clue of the instance variables or methods of
> the object that is responding to this "doModelMenu" method.  I
> think that there are probably other things wrong with the way that
> this is put together, like the way that I am trying to pass
> "thisWorld" to the evaluated phrases.  This all worked fine when I
> could just assume it was in THE World instead of trying to specify
> what world things are in.

First, which world are you concerned with? Wouldn't a menu necessarily 
want to refer to the World (i.e. the current World)? Or are you 
trying to localize this to a single drawing?

Second, instead of SelectionMenu you could use MenuMorph and the 
various add: methods; these can be given arguments, targets, etc.

The best bet would be to take each single menu operation and put it 
into a separate method. Then use the add:* methods to set up each 
MenuItem appropriately.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list