magnetic morphs

Ned Konz ned at bike-nomad.com
Wed Apr 3 15:26:56 UTC 2002


On Wednesday 03 April 2002 02:25 am, Martin Drautzburg wrote:
> Ned Konz schrieb:
> > Have you found the selection morph? Shift-drag on the desktop starts a
> > selection; once made, you can drag multiple morphs together.
> >
> > What are you trying to do with the morphs besides drag them?
>
> I have played with a "CommandButtonMorph" that can invoke arbitrary
> commands
>
> and that can be edited in situ. Now I thought it would be nice to group
> several such
> CBMs together to form some sort of Menu. 

My Connectors package has this already.

The NCMakerButton is a regular IconicButton, but it holds onto a prototype 
Morph. When you press it, it duplicates the prototype and sends it a message 
of your choosing.

The NCButtonBar is a container for these. It comes with a menu for adding more 
buttons, or you can just drop new ones on the bar.

> This would require that one CBM
> notices
> the proximity of another CBM to trigger the grouping.

Not really. In Morphic it's more common to have a parent morph that does the 
grouping and arranging. The parent can use a LayoutPolicy to choose how to 
lay them out.

Look, for instance, at what happens when you do a selection (making a 
SelectionMorph) and tell it "place into a row" from the Selection's halo 
menu.

A new Morph is constructed and all the morphs in the selection are added as 
children of that morph. The parent is set up as a table, with layout from 
left to right and no wrapping.

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list