[Pharo-project] About SimpleMorphic
siguctua at gmail.com
Mon Nov 8 00:12:47 CET 2010
On 7 November 2010 22:38, Schwab,Wilhelm K <bschwab at anest.ufl.edu> wrote:
> I disagree; the layout policy should arrange the morphs it controls. To do otherwise demands that the morphs be able to cope with any type of layout one might want. The various algorithms have to go somewhere; they might as well go in the layouts.
Some layouts, like table, indeed requiring a cooperation between
container morph and its submorphs.
But still, i think that it should be based on a simple things:
- morph should have a single layout command: lay within certain
bounds. It doesn't matters where these bounds came from or how they
Then child morph could decide for itself how to lay within given
bounds (like fill whole area or align to botton or top etc etc), and
avoid querying parent morph or layout policy/whatever to determine own
bounds, unless, of course it also having submorphs and own layout
So, if parent morph having no layout policy, it will simply pass its
own bounds to submoprhs.
And if parent having , say table layout policy, then it will calculate
table cells and pass each cell bounds to each submorph for given cell.
and yes, implementing this stuff is always harder than just talking about it :)
> From: pharo-project-bounces at lists.gforge.inria.fr [pharo-project-bounces at lists.gforge.inria.fr] On Behalf Of Igor Stasenko [siguctua at gmail.com]
> Sent: Sunday, November 07, 2010 2:50 PM
> To: Pharo-project at lists.gforge.inria.fr
> Subject: Re: [Pharo-project] About SimpleMorphic
> it is hard to say, what layout policies we may need, and what can be
> removed/simplified. What i feel wrong with scheme,
> that from message names it feels like a container morph is responsible
> for layout,
> while i think, that it is submorph(s) themselves should be responsible
> and know how to place
> them within parent morph.
Igor Stasenko AKA sig.
More information about the Pharo-project