openInWorld vs activate

Lex Spoon lex at cc.gatech.edu
Mon Oct 2 15:21:17 UTC 2000


I think the problem is that SystemWindow's think they are a main part of
the UI, and so they try to initially position and resize themselves
depending on what windows are already open and how big the display is. 
Arguably, SystemWindow's should *not* do this if their extent has been
set explicitly.

It's a tricky area. One thing you can try is to give the window a
model and override that model's #initialExtent method.  This will
work as long as you only have one window per model, and as
long as your model can come up with a reasonable initial size.  :|


-Lex



David Farber <dfarber at numenor.com> wrote:
> 
> Here's a question for all you morphic gurus out there:
> 
> Why does
> 
>   aMorph openInWorld
> 
> behave differently from
> 
>   World addMorph: aMorph.
>   aMorph activate.
> 
> (or, more to the point, why does the former not behave like the latter.)
> To illustrate further, compare the behavior of these two snippets when
> execute at the end of the following:
> 
> | alignMorph win |
> alignMorph := AlignmentMorph new.
> alignMorph
> 	centering: #center;
> 	hResizing: #shrinkWrap;
> 	vResizing: #shrinkWrap;
> 	orientation: #vertical.
> 
> alignMorph addMorphBack: (BasicButton new label: 'a button').
> alignMorph addMorphBack: (BasicButton new label: 'this is a button').
> alignMorph addMorphBack: (BasicButton new label: '''nother button').
> 
> alignMorph fullBounds.
> 
> win := SystemWindow labelled: 'fooMail console'.
> win bounds: ((alignMorph position -
> 				((0 at win labelHeight) + win borderWidth))
> 			corner: alignMorph bottomRight + win borderWidth +
> 				(2 at 2)).
> win addMorph: alignMorph frame: (0 at 0 extent: 1 at 1).
> 
> "World addMorph: win.
> win activate"
> 
>   "verses"
> 
> "win openInWorld"
> 
> When I use win activate, i get my buttons-inside-an-alignment-morph all
> wrapped in a system window. When I use openInWorld, the system window
> reverts to some default size.
> 
> What's the scoop?
> 
> thanks,
> david
> 
> --
> David Farber
> dfarber at numenor.com





More information about the Squeak-dev mailing list