Another Morphic Tutorial

Scott Wallace Scott.Wallace at disney.com
Wed Apr 18 06:28:46 UTC 2001


At 5:42 PM +1200 4/18/01, Richard A. O'Keefe wrote:

>I've spent some time poking around trying to figure out where the
>"icons" are held.  What should I do to replace these pictures with ones
>the same size and same predominant colour, but with strongly contrasting
>capital letters inside?


Richard:

Look at WonderlandCameraMorph method #installPoohIcon for an example 
of how one can replace the graphic for any given halo handle.

Then look at Preferences class method #iconicHaloSpecifications for 
the list of names by which the graphics underlying the various halo 
icons are known.

One rather labor-intensive way you could proceed would be to 
construct the icons you like (construct them with EllipseMorphs and 
TextMorphs, for example), then, in turn, grab each one from the 
screen (Form fromUser inspect), evaluate "self storeString" in each 
resulting Inspector to obtain a programmatical constructor for it, 
and then use code similar to that found in #installPoohIcon to get 
the resulting forms into the ScriptingSystem's FormDictionary.

Alternatively, it would not take too much effort to write a little 
method which, given a table of names, colors, and letters, would 
programmatically construct the desired forms and save them in the 
appropriate place; for each kind of handle, it could create an 
EllipseMorph of the appropriate size and colour, then add a 
StringMorph or TextMorph with the right characteristics to the 
EllipseMorph (as a submorph,) then obtain the resulting outer morph's 
#imageForm, and finally save that form in the ScriptingSystem's form 
dictionary.

Hope this helps.

   -- Scott





More information about the Squeak-dev mailing list