On 03 Apr 2014, at 12:50, Thomas Bany <mun.sysdev@gmail.com> wrote:
I will defenitly look into that. The "rebuild" may be missleading, is it also called at first building ?
Thatâs your own ,method, call it as/when you want
Well, I can't even manage to tweak it through hardcoding stuff on the adapter :p
Yes, itâs hardcoded in the morph themselves
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 definitely a solution :)
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.
In DynamicComposableModel, when you instantiate a model using #instantiateModels: it simulates accessors for you. By example, if you do 1 to: 120 random do: [ :i | self instantiateModels: { (âbâ, i asString) asSymbol . #ButtonModel } Then your layout can be ^ SpecLayout composed add: #b1; add: #b2; etc Ben