[Cuis] Morph instance specific mouse and drag methods
Ken Dickey
Ken.Dickey at whidbey.com
Sun Jan 12 23:33:21 CST 2014
Hi Juan,
Not sure you want this yet, but no ill effects and seems much simpler than the eToys handler code.
I am posting to the group in case anyone wants to experiment with instance specific behaviors (done with "handlers" in Squeak).
Try loading the change set then drag a morph from the World > New Morph.. menu
Open an inspector on the morph (Command-click menu: debug > inspect morph) and add a mouse click behavior:
"==================="
self setProperty: #handlesMouseDown: toValue: #true.
self setProperty: #mouseButton1Up:localPosition:
toValue: [ :evt :posn | self color: self color negated ].
"==================="
Then click on the morph.
Another fun thing to try is opening a BorderedRectMorph and setting property #allowsSubmorphDrag. Embed a submorph and drag it out.
Cheap tricks, but then everybody likes a bargan. ;^)
Cheers,
-KenD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1911-CuisMediaAuthor-KenD-2013Dec31-14h23m-KenD.1.cs.st
Type: application/octet-stream
Size: 6217 bytes
Desc: not available
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20140112/c17519f4/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MorphProps.png
Type: image/png
Size: 173719 bytes
Desc: not available
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20140112/c17519f4/attachment-0004.png>
More information about the Cuis
mailing list