Hi !First, I apologyse for the wall of text.
I'm trying my hands at Spec and I have few questions:
- How can I implement an instance-dependent layout ?
I tried to simply put a layout in an instance method with theRegarding the layout method lookup, the documentation states that it "starts on instance side, which allows a UI to have a more specific layout depending on the state of the instance"
<spec: #default>pragma. But not only was it not retrieved by ComposableModel>#defaultSpecSelector but ComposableModel>#retrieveSpec: will send the selector on the class anyway.
What I ended up doing was overiding #openWithSpec (which worked) but I'm pretty sure that my model is not composable at all.
- Is it possible to change the "skin" of the basic widget ?
I would like to implement some sort of toggle button by changing the color of ButtonModel and so far, I failed. I was not able to trace my color change up to the PluggableButtonMorph because it seems to use anoucement and I'm a Smalltalk rookie.
I tried however to send #color: directly to the morph which does nothing: the #changed method rolls it back to its previous value. So I may be doing something wrong but it doesn't feel like the issue comes from Spec. Any clue ?
And I came up with this :
- On a side note, I tried to send an argument to the selector that retrieve a widget in the layout method.
layout add: {#buttonAt: . 1}; add: {#buttonAt: . 2}; add: {#buttonAt: . 3}
Is it how it's done ?
Thanks in advance !