On 25 June 2013 11:38, Stéphane Ducasse <[email protected]> wrote: > Morph>>assureLayoutProperties > | props | > props := self layoutProperties. > props ifNil:[ > props := LayoutProperties new initializeFrom: self. > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > self layoutProperties: props]. > ^props > > > LayoutProperties >> initializeFrom: defaultProvider > "Initialize the receiver from a default provider" > self hResizing: defaultProvider hResizing. > self vResizing: defaultProvider vResizing. > self disableTableLayout: defaultProvider disableTableLayout. > > ok up here. > > Morph>>hResizing > "Layout specific. This property describes how the receiver should be > resized with respect to its owner and its children. Possible values are: > #rigid - do not resize the receiver > #spaceFill - resize to fill owner's > available space > #shrinkWrap - resize to fit children > " > | props | > props := self layoutProperties. > ^props ifNil:[#rigid] ifNotNil:[props hResizing]. > > > argh…. > > Stef
things which you can easily do in prototype-based system, not easy in class-based. Here, i think a side effect of porting Morphic from self to smalltalk. So, in prototype-based system, a prototype could have a default property (like hResizing) and hold some default value (#rigid, for instance)... like that, all objects which inherit from that one, will also inherit this property. But if one would like to set it, it will set new value of this property, but not in prototype, but actually in object which you sent message to. That's why all this dance with ifNil: ... -- Best regards, Igor Stasenko.
