[Glamour] selection action

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

[Glamour] selection action

Damien Cassou
In the following browser, whatever is selected in the list, if I press
Modifier-i I get an inspect on 5.

===========================================
|browser|
browser := GLMTabulator new.
browser row: #list.

browser transmit to: #list; andShow: [:a |
        a list
                display: [:v | v to: 10 * v];
                selectionAct: [:pres :selection | selection inspect] on: $i
entitled: 'Inspect'
        ].
browser openOn: 5
===========================================

How can I get an inspect on what is really selected?

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
_______________________________________________
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] selection action

Tudor Girba-2
Hi,

The second argument is the entity. If you want to inspect the selection you do:

pres selection inspect

Cheers,
Doru



On 23 Aug 2011, at 11:47, Damien Cassou wrote:

> In the following browser, whatever is selected in the list, if I press
> Modifier-i I get an inspect on 5.
>
> ===========================================
> |browser|
> browser := GLMTabulator new.
> browser row: #list.
>
> browser transmit to: #list; andShow: [:a |
> a list
> display: [:v | v to: 10 * v];
> selectionAct: [:pres :selection | selection inspect] on: $i
> entitled: 'Inspect'
> ].
> browser openOn: 5
> ===========================================
>
> How can I get an inspect on what is really selected?
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Lambdas are relegated to relative obscurity until Java makes them
> popular by not having them." James Iry
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"We cannot reach the flow of things unless we let go."




_______________________________________________
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] selection action

Damien Cassou
On Tue, Aug 23, 2011 at 11:54 AM, Tudor Girba <[hidden email]> wrote:
> The second argument is the entity.

ok thanks. Why is the 'entity' passed to the block and not the
'selection'? It looks like the 'selection' is more useful for a
selectionAct:*

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
_______________________________________________
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] selection action

Tudor Girba-2
Hi,

Good question.

The convention is to always pass the values from the entity are always passed as the end arguments.

In any action, the first argument provides access to the entire presentation. The selection is exactly one object, so it is easy to access it from the presentation. The entity however can be a MultiValue, so it can be less convenient to access. This is why we pass the entity values explicitly.

Why not pass the selection as well? Because it is already difficult to remember the list of all parameters. In this case, adding another one would only create more problems without visible benefits.

Cheers,
Doru


On 23 Aug 2011, at 19:27, Damien Cassou wrote:

> On Tue, Aug 23, 2011 at 11:54 AM, Tudor Girba <[hidden email]> wrote:
>> The second argument is the entity.
>
> ok thanks. Why is the 'entity' passed to the block and not the
> 'selection'? It looks like the 'selection' is more useful for a
> selectionAct:*
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Lambdas are relegated to relative obscurity until Java makes them
> popular by not having them." James Iry
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Obvious things are difficult to teach."




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