[squeak-dev] Layout policy ignored for morphs w/o submorphs... ?

Marcel Taeumel marcel.taeumel at student.hpi.uni-potsdam.de
Wed Jan 21 15:50:33 UTC 2015


Hi! :)

There is something strange going on in Morphic land considering layout
policies and their rights. :D Consider this excerpt from Morph >>
#doLayoutIn:

...
submorphs isEmpty ifTrue: [^fullBounds := priorBounds].
...

Okay, the policy has no chance because this is not called then:

...
layout := self layoutPolicy.
layout ifNotNil: [layout layout: self in: layoutBounds].
...

Furthermore, Morph >> #layoutBounds dares to preprocess #layoutInset (which
will be stored in an instance of TableProperties ... ?!) like this:

| inset box |
inset := self layoutInset.
box := self innerBounds.
inset isZero ifTrue:[^box].
^ box insetBy: inset

Phew. Obviously, the TableLayoutPolicy should access a morph's layout inset
during actual layout (i.e., #layout:in:).

My questions:

- Why should a morph keep its prior extent by default when having no
submorphs?
- Can we (I^^) give layout policies more control about whether to layout
even w/o submorphs?
- Can we (I^^) move #layoutInset processing to TableLayout?
- Can we (I^^) move code about proportional layouting from Morph to
ProportionalLayout?

Best,
Marcel



--
View this message in context: http://forum.world.st/Layout-policy-ignored-for-morphs-w-o-submorphs-tp4800819.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.


More information about the Squeak-dev mailing list