New problem with Spec.
Layout consists of menu and custom control (subclass of Morph created by asSpecAdapter):
initializeWidgets
menu := self instantiate: MenuModel.
self setupMenu.
menu applyTo: self.
locationField := LocationFieldMorph new asSpecAdapter.
defaultSpec
<spec: #default>
^ SpecLayout composed
newColumn:
[ :col |
col
add: #menu height: self toolbarHeight;
add: #locationField
] yourself
My custom control doesn't automatically resize to fill the area reserved to it by layout spec.
I've tried different existed controls instead of mine but didn't find any solution. Some controls resized (TextModal) some didn't (Morph, BorderedMorph, EllipseMorph).
I did a dirty hack: in onDraw: of my custom control i set bounds: to aCanvas clipRect and it works fine.
drawOn: aCanvas
self bounds: aCanvas clipRect .
.... other code ....
But i think it is a wrong solution and there is somewhere a simple property to setup ( or something like it ).
Any ideas?