I've done some poking around with TableLayout, and I'm starting to get a feel for how it works. One that I haven't puzzled out is how to make a morph (I'm using a TextMorph inside a BorderedMorph) expand and contract as its containing morph (in my case, another BorderedMorph) is resized. Any advice on this would be appreciated.
Thanks, Mike
-----Original Message----- From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners-bounces@lists.squeakfoundation.org] On Behalf Of Herbert König Sent: Thursday, 30 October 2008 9:51 a.m. To: A friendly place to get answers to even the most basic questions aboutSqueak. Subject: Re: [Newbies] Morphic Layout
Hello Michael,
GM> Can anyone help me learn the 'modern' way oflaying out GM> morphs? I'm trying to create a stack-based ('RPN')calculate in GM> So, what is the best way to layout a set of morphs? At GM> leastfor now, all I need is a grid of buttons, that will look GM> sensible when theparent calculator morph is resized.
TableLayout is your friend here. The class comment gives some hints. A week or so ago there was a discussion about Morphic table layouts, there you can find hints where to get grid layouts.
In general you can send a Morph layoutPolicy: TableLayout new
I suggest you create a Morph, add a TableLayout like above, bring up the halo, the red button offers layout.
There you can experiment and see the options you have.
If you don't look into the thread in Squeak dev, beware TableLayout is no real table layout but a row or column layout.
Hello Michael,
GM> I've done some poking around with TableLayout, and I'm GM> starting to get a feel for how it works. One that I haven't GM> puzzled out is how to make a morph (I'm using a TextMorph inside a GM> BorderedMorph) expand and contract as its containing morph (in my GM> case, another BorderedMorph) is resized. Any advice on this would GM> be appreciated.
the inner Morph must have its childLayout horizontalResizing set to #spaceFill. same with verticalResizing.
I never know this when I need it, so I take a rectangle and an EllipseMorph from the object catalog, put the ellipse inside the rectangle (red halo, embed into) and then I play with both Morphs layout options.
Don't forget to pin both Morphs Menus to the screen.
beginners@lists.squeakfoundation.org