[Pharo-users] Spec layout

stepharo stepharo at free.fr
Wed May 18 04:20:21 EDT 2016


marion the solution is what peter proposes.

Stef


Le 18/5/16 à 11:14, Marion Noirbent a écrit :
> In fact i was trying to modify RadioButtonGroup to turn it into a 
> widget, #buttons is not a widget but its collection of widget.
>
> May you have confused RadioButtonGroup with the MenuModel / 
> MenuGroupModel / MenuItemModel which are widgets. I take inspiration 
> from them and I would got the same kind of behaviour.
>
> Le 17/05/2016 21:11, stepharo a écrit :
>> Thanks Johan
>>
>>
>> We looked at
>>
>> RadioButtonGroupExample
>>
>> but you see we cannot have a RadioButtonGroupPresenter having 2, 3 or 4
>> radioButton.
>>
>> Stef
>>
>>
>> Le 17/5/16 à 18:52, Johan Fabry a écrit :
>>> Hi Marion,
>>>
>>> the class side message of defaultSpec is generally meant to be used if
>>> you use a fixed number of widgets, so you can put the reference to the
>>> name of each widget there (in cour case #buttons). For variable number
>>> of widgets you should have a look at the dynamic features of Spec.
>>>
>>> That being said, It looks like what you really want to use is a Radio
>>> Button Group. Have a look at RadioButtonGroupExample.
>>>
>>> HTH
>>>
>>> -- 
>>> Does this mail seem too brief? Sorry for that, I don’t mean to be
>>> rude! Please see http://emailcharter.org .
>>>
>>> Johan Fabry   -   http://pleiad.cl/~jfabry
>>> PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -
>>> University of Chile
>>>
>>>> On May 17, 2016, at 13:48, Marion Noirbent
>>>> <ms.noirbent at etudiant.univ-lille1.fr> wrote:
>>>>
>>>> Hi,
>>>> I'm trying to create a widget whith Spec, managing a collection of
>>>> RadioButton. But I have a problem with defaultSpec (the accessor of
>>>> the collection is the methods "buttons") :
>>>>
>>>> If i put defaultSpec on class side, i can't acces the collection of
>>>> the instance. (the following code iterate on the string)
>>>>
>>>> defaultSpec
>>>>     <spec: #default>
>>>>     ^ SpecLayout composed
>>>>         newColumn: [ :column | #buttons do: [ :item | column add:
>>>> item ] ];
>>>>         yourself
>>>>
>>>> If i put it on instance side, the lookup don't find it (in the book
>>>> Building UI with Spec, it said the lookup begin by the instance side
>>>> and it allow to have specific UI, in part about layout)
>>>>
>>>> defaultSpec
>>>>     <spec: #default>
>>>>     ^ SpecLayout composed
>>>>         newColumn: [ :column | self buttons do: [ :item | column add:
>>>> item ] ];
>>>>         yourself
>>>>
>>>> Any idea ?
>>>>
>>>> Marion Noirbent,
>>>>
>>>>
>>>
>>>
>>
>>
>





More information about the Pharo-users mailing list