Glamour Roassal transfer on click

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

Glamour Roassal transfer on click

Uko2
Hi,

roassal views have a nice feature in glamour - a new glamour pane is opened when an entity is clicked. This is being set up by:

aView raw allElementsDo: [:each |
        each on: ROMouseClick do: [:event | self selection: each model ]] ].

in GLMRoassalPresentation>>renderOn:.

I’d like to know if there is a possibility to do it yourself, because I generate some nodes dynamically when view is already displayed.

Cheers.
Uko
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Glamour Roassal transfer on click

Ben Coman
Yuriy Tymchuk wrote:

> Hi,
>
> roassal views have a nice feature in glamour - a new glamour pane is opened when an entity is clicked. This is being set up by:
>
> aView raw allElementsDo: [:each |
> each on: ROMouseClick do: [:event | self selection: each model ]] ].
>
> in GLMRoassalPresentation>>renderOn:.
>
> I’d like to know if there is a possibility to do it yourself, because I generate some nodes dynamically when view is already displayed.
>
> Cheers.
> Uko
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>  

A bit of a hack and only a quick pass at the concept, but one way to do
this might be...

    ROView subclass: YourROView
    instanceVariableNames: 'allElementsBlock'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'YourApplication'

    YourROView>>allElementsDo: aBlock
       super allElementsDo: aBlock.
       allElementsBlock := aBlock.

    YourROView>>add: element
       super add: element.
       allElementsBlock ifNotNil: [ allElementsBlock value: element ].

This requires Glamour to be able to use YourROView instead of
ROMondrianViewBuilder.  This facility is provided by loading the
following packages attached to comment #9 of Issue 900 [1]
[1] https://code.google.com/p/moose-technology/issues/detail?id=900
(Note you probably only need to read down from comment #7)

btw, I'm not sure #newViewBlock is the best method name.  Any ideas for
naming?

cheers -ben



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev