[Q] [Morphic] SystemWindow
Ned Konz
ned at bike-nomad.com
Sat Mar 8 20:30:56 UTC 2003
On Saturday 08 March 2003 06:03 am, Chris Burkert wrote:
> Hello Squeakers
>
> I want to build a nice SystemWindow for my application. The problem
> is resizing. For example take a Package Browser and resize it as
> small as possible. There will be Morphs displayed outside the
> SystemWindow.
Not if you tell the SystemWindow to clip.
> My code with the same problem would look like this (a DoIt should
work):
> | window playfield bar |
>
> bar _ (RectangleMorph new) width: 500.
> window _ (SystemWindow labelled: 'my App').
> playfield _ (RectangleMorph new)
> layoutPolicy: TableLayout new;
> hResizing: #spaceFill;
> vResizing: #spaceFill.
> playfield addMorph: bar.
> window
> addMorph: playfield fullFrame: (LayoutFrame fractions: (0 at 0
> corner: 1 at 1) offsets: (0 at 0 corner: 0 at 0));
> openInWorld.
The playfield hResizing and vResizing aren't used if you use a
ProportionalLayout for its parent.
Try doing this to clip:
window clipSubmorphs: true.
And if you do this:
bar hResizing: #spaceFill.
the bar will resize too.
> Now the Titelbar and some colors are displayed completely wrong
> _but_ it resizes correct. I believe this is a problem with
> Alignment. Is there a way around so that the window displays itself
> correct _and_ it resizes to #shrinkWrap?
Yes.
Do what you did in the earlier example, using a pane that is set to
the full proportional frame; make that a container.
I believe that SystemWindow counts on having a ProportionalLayout so
it can lay its titlebar, pane morphs, etc. out correctly.
> Should SystemWindow be refactored so that it supports the newer
> layout Policies?
As you've noticed, it seems to be happiest with ProportionalLayout (at
least with paneMorphs set up).
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|