The usual solution is to have a method looking like this on instance side
rebuildMyLayout
| layout | layout := self buildStateDependentLayout. self buildWithLayout: layout.
buildStateDependentLayout ^ SpecLayout composed etc...
I will defenitly look into that. The "rebuild" may be missleading, is it also called at first building ? The hooks are basically here, but the Morphs have an issue with this.
The "skin" of a Morph is supposed to be immutable, hence it takes back its default value at each refresh :S
Well, I can't even manage to tweak it through hardcoding stuff on the adapter :p Do you think it would be hard to use a SimpleSwitchMorph ? As I understood, there is #asSpecAdapter that permis to plug pretty much everything ? Plus, making a specific adapter seems doable (I mean for a rookie like me).
That's a solution. Then if you have a fixed number of buttons, you could also implement a getter for each.
If you have an undetermined number of button, then DynamicComposableModel is for you.
Well, I definitely have a variable number of buttons, depending on the model instance. Actualy, I want my model to be a matrix of toggle to specify a mask. I create instance with: MaskModel class>#maxIndex: anInteger ^(self basicNew) maxIndex: anInteger; initialize; yourself and instantiate a collection of buttons in #initializeWidgets. It doesn't change much after that so a DynamicComposableModel didn't seem usefull. But I only though that because I never used it. I will give it a try. Anyway, thanks again for your time ! Thomas.