Resizing a BookMorph
Scott Wallace
Scott.Wallace at disney.com
Thu Jan 27 19:12:49 UTC 2000
>>3) How do I resize BookMorphs. I choose resize, get a yellow blob, aim it at
>>the edges click and it disappears!?
>
>As far as I know, it's not possible. The problem is resizing
>everything inside as well, but perhaps a more wise Morphic-er can
>answer.
Rather than having its own inherent size, a standard BookMorph
dynamically adjusts its size such that it precisely encloses the
contents it is currently displaying. (In AlignmentMorph terminology,
it uses "shrinkWrap" resizing.)
If you're looking at a BookMorph and you want it to appear larger or
smaller, simply resize its current *page* (via the page's halo,) and
the BookMorph will obligingly resize to fit around it.
That will accomplish what you're after -- but only as long as you
don't flip the page!
If you want *every* page of the book to assume the new size, request
"make all pages this size". Then the book will remain the same size
as you flip from page to page. (When you've constructed a book more
or less linearly, all pages are likely already to be the same size,
so the issue won't arise. But if you've patched the book together
from disparate sources, the issue can be very real, and you will be
thankful for the ability to reconfigure all pages to be the same
size.)
One can easily imagine wanting other sizing behaviors for Book-like
morphs, and indeed some alternatives are already currently available,
though little-used and hence likely to be problematical.
For example, by manually changing the hResizing and vResizing
properties of a BookMorph to be #rigid, you can suppress the
"shrinkWrap" behavior, but without further work you'll have adverse
display artifacts because you'll find that oversize pages obtrude
beyond the book's edges, etc. Using #spaceFill rather than #rigid
will bring about somewhat different behavior. None of these is
likely to be completely satisfactory at present.
Since the BookMorph has emerged as a primary unit of exchange for
media in Squeak, we probably need to retool it to handle a wider
variety of needs. BookMorph's patchwork evolution has resulted in a
rather idiosyncratic collection of options offered in its menu, and
the shrink-wrap behavior that is more-or-less hard-wired frequently
causes confusion.
-- Scott
More information about the Squeak-dev
mailing list
|