SystemWindow question

Kevin Fisher kgf at golden.net
Sun Oct 14 04:09:13 UTC 2001


Hi Jim:

Yes, I noticed the colour changes...I rushed to try Karl's suggestion of
embedInWindow and noticed that my "main" morph colour becomes white once
embedded.  After browsing the methods in SystemWindow I see that this is
explicitly done.

Thanks for the additional information, this definitely helps!

On Sat, Oct 13, 2001 at 10:17:40AM -0700, Jim Benson wrote:
> Kevin,
> 
> Morph>>embedInWindow works to some degree, but it messes with the colors of
> the morphs that you place in there. A SystemWindow really wants you to have
> a Model attached so it knows where to get certain bits of info like what
> color the panes are and stuff.
> 
> There are quite a few examples in the image, but basically what you want to
> to is make a subclass of Model, and the build an appropriate openAsMorphOn:
> type method which instantiates a SystemWindow, figures out the correct
> extent of the window and resizes it accordingly, and adds your new friend
> (using addMorph:frame if you want the layout info to go along with it). [
> embedInWindow gives clues as how to size the SystemWindow ].
> 
> Don't forget to define #defaultBackgroundColor in the model to give you the
> background color of the window.
> 
> 
> Hope this helps,
> 
> Jim
> 
> ----- Original Message -----
> From: "Kevin Fisher" <kgf at golden.net>
> To: "squeak-dev" <squeak-dev at lists.squeakfoundation.org>
> Sent: Saturday, October 13, 2001 9:34 AM
> Subject: SystemWindow question
> 
> 
> > Hi folks:
> >
> > I've never had much luck with SystemWindows in the past...they never do
> > what I want them to do and I spend hours playing with methods that only
> > make the situation worse...which is why I avoid programming with them,
> > usually. :)
> >
> > My question:
> >
> > I have a Morph...actually, it's an AlignmentMorph that I'm adding other
> > Morphs to.  When I'm done adding morphs, I'd like to plunk the whole
> > thing down in a SystemWindow and have the SystemWindow actually wrap
> around
> > the border of the topmost Morph (in my case, the AlignmentMorph).  Nothing
> > I've tried seems to work..I always get a SystemWindow that is the wrong
> > size with my morphs sticking out all over the place.
> >
> > I know that I can use the SystemWindow to make contained morphs conform
> > to the contstraints of the SystemWindow (using addMorph:frame:), but how
> > do I do the converse?  For what I want to do, using addMorph:frame: isn't
> > terribly convenient.
> >
> > Any advice would be appreciated!
> >
> >
> >
> 
> 




More information about the Squeak-dev mailing list