[Squeakland] Including morphs into flaps

Ned Konz ned at bike-nomad.com
Thu Mar 24 08:51:35 PST 2005


On Thursday 24 March 2005 3:35 am, Scott Wallace wrote:
> It's important to realize -- and not widely known -- that if you have
> a scripted object in a parts bin, and you drag out ("tear off") a
> fresh copy of that object from that parts bin, the object you will
> obtain will *always* be an instance of a new and different class --
> *not* a sibling instance of the original object.
>
> (It's not unreasonable to expect that this should work differently,
> i.e. that it should be possible to obtain genuine siblings from a
> parts bin; but this is the way it works right now.)
>
> The only ways to get "siblings" -- i.e. instances of the same class
> -- are by using the olive halo handle, or the halo-menu items for
> making siblings found in the "halo actions" and "siblings..."
> submenus, or using the scripting tile named "copy."  To repeat:  You
> cannot obtain a sibling instance from a parts bin, you always get an
> instance of a new class.  (The more I think about this, the more I
> realize how regrettable this is...)

Actually, there is an alternative kind of flap available that works as you 
want. So Scott doesn't have to do any work to make this happen.

These are the flaps that I made as part of Connectors; these always make 
siblings.

If you go to the Objects tool, go to the "Connectors" page, and drag out a 
"Button Flap", you will have a flap that works like this:

* a right (or middle) mouse click will bring up a context menu.

* Choosing 'add button' will add a Maker Button to the flap.

* Dropping a scripted Morph (and/or one with instance variables) on the button 
will make a sibling of that morph to use as a prototype. (if the morph does 
not have scripts or instance variables, you just get a copy)

* Clicking on the button (after you drop a morph on it) will give you a 
sibling of the prototype (which is also a sibling of your original morph) in 
hand.

* Dragging from the button (as you are used to doing with flaps) will also do 
the same thing.

Give it a try!
-- 
Ned Konz
http://bike-nomad.com




More information about the Squeakland mailing list