Buttons in Morphic

Karl Ramberg karl.ramberg at chello.se
Sat Apr 7 06:50:26 UTC 2001


In tile scripting / etoy you would probably benefit from using 
the predefined category for button actions. 

Karl

Dan Shafer wrote:
> 
> I've just spent several hours over the last two days delving into
> SimpleButtonMorph and trying to understand why buttons in Morphic don't behave
> the way I expected them to behave. If I have this right, it is completely
> unclear to me how buttons are _suppsoed_ to be used in Morphic.
> 
> Here's what I _think_ I've learned.
> 
> A SimpleButtonMorph appears to "eat" the usual mouse events: mouseDown,
> mouseUp, and mouseStillDown. It has a default "flash" behavior that it executes
> on mouseUp. Even though its halo menu has an item called "add mouseUp action,"
> doing so seems to have no discernible effect. Neither, for that matter, does
> "remove mouseUp action." You can write a script for such a button, set it to
> active on mouseUp and you can click on that sucker until your hand breaks and
> nothing is going to happen. This despite the fact that when you click on the
> instant-execution yellow exclamation point in the script tile, the script runs
> exactly as expected every time.
> 
> I conclude, at least tentatively, that the intent is that SimpleButtonMorphs
> are _not_ supposed to be buttons in the sense that _I_ at least have come to
> think of them: pluggable widgets that you attach to a script to execute. It
> appears to me that one would have to do some development that did not involve
> only direct manipulation of Morphs to make a SimpleButtonMorph behave as I
> expected.
> 
> Please note that I am neither complaining nor suggesting that my expectation
> should carry the day. I am only trying to understand the reasoning behind the
> design and intended use of these seductive little buttons that are so stubborn
> in my world-view!
> 
> I have resorted to creating my own button-like objects out of rectangles and
> text and which therefore have no default behaviors or assumptions about what
> they will or will not do when clicked. As I am writing a tutorial based on this
> experience, I obviously prefer to be right so if this is wrong-headed, someone
> please tell me!
> 
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/





More information about the Squeak-dev mailing list