pharo-graphics / Toplo

A widget framework on top of Bloc
MIT License
17 stars 8 forks source link

ToRadioButton group handler lost when dresser is changed with using startChecked #28

Closed labordep closed 1 year ago

labordep commented 1 year ago

When a ToRadioButton is used in a ToCheckableGroup this is not possible to change the dresser without lost the link between the group and the widget. Possibility to have the same problem for ToCheckBox.

This problem appears when the option startChecked is used.

May be another observer should be added in ToCheckableGroup>>initialize for observing a specific dresser update/change of the widget and to reinstall the behavior.

The lost behavior is :

ToCheckableGroupCheckingStrategy>>buttonInserted: aCheckable in: aGroup

    aCheckable group: aGroup.
    aCheckable whenCheckedDo: [ aCheckable check ].
    aCheckable whenUncheckedDo: [ aCheckable uncheck ]
labordep commented 1 year ago

Find a test in the branch https://github.com/plantec/Toplo/tree/issue28 to reproduce the problem, if you remove startChecked there is no problem : ToCheckableGroupTest>>testCheckableGroupChangeCheckBoxDresser