Glamour question

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

Glamour question

Nicolas Anquetil

In a Glamour browser with 3 pane (#master, #slave1, #slave2)

I would like to be able to "send" the selection in #master either to
#slave1 or #slave2

a nice behaviour would be:

- if I select a line into #master, it is transmitted to #slave1
(browser transmit) from: #master; to: #slave1

- but on a context menu in #master, I can tell him to send to #slave2
instead
   act: [:each | each selection something-here] entitled: 'Display in
slave 2';

among other things, it means the selection+context menu in #master would
not automatically transmit to #slave1


Another question is what should I put in the act: block to transmit to
#slave2 ?

nicolas

--
Nicolas Anquetil -- RMod research team (Inria)

_______________________________________________
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 question

Tudor Girba-2
Hi,

The way to do this is to create transmissions from custom ports, and to populate those from the actions.

Here is an example:

composer := GLMCompositePresentation new.
composer tabulator with: [:t |
        t column: #index; column: [:c | c row: #recepient1; row: #recepient2].
        t transmit to: #index; andShow: [:a |
                a list
                        selectionAct: [:list | (list pane port: #custom1) value: list selection ] on: $1 entitled: 'To recepient 1';
                        selectionPopulate: #custom2 on: $2 entitled: 'To recepient 2' with: [:list | list selection ] ].
        t transmit from: #index port: #custom1; to: #recepient1; andShow: [:a |
                a text title: 'Recepient 1'].
        t transmit from: #index port: #custom2; to: #recepient2; andShow: [:a |
                a text title: 'Recepient 2'].
        ].
composer openOn: ($a to: $z)

In this example, I use two ways to populate a custom port:
- Using the default API: selectionAct: [:list | (list pane port: #custom1) value: list selection ] on: $1 entitled: 'To recepient 1'
- Using the shortcut API (the same as above, only with slightly nicer method names): selectionPopulate: #custom2 on: $2 entitled: 'To recepient 2' with: [:list | list selection ] ]

Cheers,
Doru


On Jan 19, 2013, at 11:21 AM, Nicolas Anquetil <[hidden email]> wrote:

>
> In a Glamour browser with 3 pane (#master, #slave1, #slave2)
>
> I would like to be able to "send" the selection in #master either to #slave1 or #slave2
>
> a nice behaviour would be:
>
> - if I select a line into #master, it is transmitted to #slave1
> (browser transmit) from: #master; to: #slave1
>
> - but on a context menu in #master, I can tell him to send to #slave2 instead
>  act: [:each | each selection something-here] entitled: 'Display in slave 2';
>
> among other things, it means the selection+context menu in #master would not automatically transmit to #slave1
>
>
> Another question is what should I put in the act: block to transmit to #slave2 ?
>
> nicolas
>
> --
> Nicolas Anquetil -- RMod research team (Inria)
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"We are all great at making mistakes."








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