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?
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 Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"We cannot reach the flow of things unless we let go."
On Tue, Aug 23, 2011 at 11:54 AM, Tudor Girba tudor@tudorgirba.com 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:*
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 tudor@tudorgirba.com 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 Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"Obvious things are difficult to teach."