Hi guys,

A comment from building Spec layouts for widgets (Pharo 6 but maybe
applicable to Pharo >= 7): I have built a Spec widget which could have
two layouts: #buttonsOnTopSpec and #buttonsOnBottomSpec :

SpcLabeledActionsList new
   openWithSpec: #buttonsOnTopSpec;
   yourself.

SpcLabeledActionsList new
   openWithSpec: #buttonsOnBottomSpec;
   yourself.

Now if you would have to set such list as a widget in
#initializeWidgets, the building process follows its path to
#private_buildWithSpec which hardcodes the spec layout to the
#defaultSpecSelector (the one containing <spec: #default> pragma).

The problem subclassing from DynamicComposableModel / Presenter is
that is trying to solve two problems at once:

1) Dynamic adding/removing widgets
2) Dynamic configuration of layout

In this case I just need the 2), and I would have to remove inst. vars
and accessors in ~20 classes because the dynamic widgets dictionary
now stores all widgets, or interject a weirdo between
ComposableModel/Presenter and DynamicComposableModel/Presenter.

What would you do?

Cheers,

Hernán

Reply via email to