[ENH] a DoitButtonMorph
David N. Smith (IBM)
dnsmith at watson.ibm.com
Sat Nov 3 00:21:49 UTC 2001
Hi:
Recently I needed a button that would simply do a doit on some code; I hacked up a subclass of RectangleMorph and used that in a demo. It seemed useful enough that I more properly implemented one as a subclass of SimpleButtonMorph. A file-in is attached. It was developed on 3.2 but should ... blah ... .
>From the class documentation:
----------
I am a button, like SimpleButtonMorph, except that I evaluate a string when pressed. I can be used to add buttons on the screen wherever you want, and which do most anything a DoIt will do. The Halo menu lets the label and doit string be changed when you wish.
DoitButtonMorph new openInWorld
Useful variations are:
DoitButtonMorph new
label: 'Open Selector Browser';
doitString: 'SelectorBrowser new open';
openInWorld
and, to exit a project:
DoitButtonMorph new
label: ' ^ ';
doitString: 'Project returnToPreviousProject';
openInWorld
-----------
I'm open for suggestions, criticisms, or whatever. There may even be such a button somewhere (Transforming3DPressThingMorph or something) but I couldn't find one.
Dave
-------------- next part --------------
Skipped content of type multipart/appledouble
More information about the Squeak-dev
mailing list
|