[bug] Connectors or Stack Morph?
scott.wallace at squeakland.org
Tue Oct 14 08:24:11 UTC 2003
The point of using a StackMorph is to share the same set of morphs
among many different "cards". To set up the sharing mechanism, place
the morphs that are to be shared on the "background" of the stack.
As you navigate from card to card in a stack that has its background
set up, each individual card's data-values (the values of the
instance variables of the individual Card objects) get placed into
the corresponding morphs (the "Fields" to use the HyperCard term) of
the same paste-up.
(Contrast a BookMorph, in which every "page" is completely disjoint,
and there is no sharing of code, and no sharing of morphs.)
Since your morphs were not put *onto the background* of the stack,
the morphs were considered "private" to just the one card on which
they were created; and when you subsequently hit the + button --
which installs a new *card* into the current background -- those
morphs that were private to just the existing card had to be deleted.
Which led to the phenomenon you encountered.
To solve the problem...
(1) If you actually want and need a stack/card structure, i.e. you
want to share the same set of morphs among multiple cards, simply put
your morphs on the background of the StackMorph (halo-menu, stacks
and cards...) Once you've done that, your morphs won't disappear as
you add new cards or navigate from card to card.
(2) If you *don't* need a stack/card structure, don't use a
StackMorph. In this case, probably a BookMorph is what you need.
Documentation is poor for StackMorphs, but before trying to do
anything with them, you should bring up the Stack Tools flap and from
there obtain a "Stack Help" window and absorb what it says there.
PS: As Alan intimated, the "StackMorph" work was a learning
experience, and one that is not being further advanced in its current
form. And I'm not aware of anyone in the community who is actively
It is actually possible to do anything with StackMorphs that one
could do in HyperCard, and indeed much more, but you really need to
know what you're doing, and there is no HyperCard-like library of
prebuilt goodies, and you probably need to be adept at dodging bugs.
So the best advice for the moment is probably not to use StackMorphs
The next run(s) at stack-like features will benefit greatly from this
experience, and in particular we will be sure to make the individual
"card" objects be concurrently visible and manipulable in multiple
places and multiple ways. And to support many more kinds of "data"
than just text and pictures.
At 6:50 AM -0700 10/11/03, David Faught wrote:
>With a stock 3.5 image on Windows and Connectors 1.9 freshly loaded
>from SqueakMap, here is how to recreate this problem:
>1. Put a Stack morph on the screen (from the Objects morph Presentation
>pane, for example)
>2. On the Stack morph page, build a simple diagram, such as two Basic
>Shapes connected by a connector (all from the Connectors flap)
>3. Add a new page to the Stack morph
>4. When you go back to the page with the simple diagram, the connector
>has become unconnected at both ends.
>I tried this with a Book morph and it works fine, only the Stack morph
>seems to be a problem.
>This is not terribly pressing as far as I am concerned, and I know you
>have said something about a new version coming out soon, but I thought
>I would point this out.
More information about the Squeak-dev