Spec: custom layouts for sub-models

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Spec: custom layouts for sub-models

Sean P. DeNigris
Administrator
I have a UI, let's call it ParentUI, which includes ChildUI - another ComposableModel. In the default layout, ChildUI includes a toolbar.

When embedded in the ParentUI, I want the toolbars to be merged. It is easy to include the ChildUI tools in the ParentUI bar by adding ParentUI>>childTools, which I can then #add: to the layout. But the ChildUI tools also still show up in ChildUI (so they appear twice).

I ended up defining ChildUI>>#noToolbarSpec, which I can pass to the layout like "add: #(#currentScenario. #noToolbarSpec)", and which delegates to ChildUI class>>#noToolbarSpec. I want to have the default ChildUI spec simply extend noToolbarSpec, but I didn't look into that yet.

Anyway my question is: is this the best way to do what I'm trying to do?

Thanks!
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Spec: custom layouts for sub-models

Benjamin Van Ryseghem (Pharo)
Sorry for the delay, I was on holidays :)

Can you tell me more please ?

Ben

Ben

On May 28, 2013, at 9:14 PM, Sean P. DeNigris <[hidden email]> wrote:

I have a UI, let's call it ParentUI, which includes ChildUI - another
ComposableModel. In the default layout, ChildUI includes a toolbar.

When embedded in the ParentUI, I want the toolbars to be merged. It is easy
to include the ChildUI tools in the ParentUI bar by adding
ParentUI>>childTools, which I can then #add: to the layout. But the ChildUI
tools also still show up in ChildUI (so they appear twice).

I ended up defining ChildUI>>#noToolbarSpec, which I can pass to the layout
like "add: #(#currentScenario. #noToolbarSpec)", and which delegates to
ChildUI class>>#noToolbarSpec. I want to have the default ChildUI spec
simply extend noToolbarSpec, but I didn't look into that yet.

Anyway my question is: is this the best way to do what I'm trying to do?

Thanks!



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/Spec-custom-layouts-for-sub-models-tp4690508.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.