Status: Accepted Owner: damien.c...@gmail.com CC: tudor.gi...@gmail.com, cy.delau...@gmail.com Labels: Type-Other Priority-Medium Component-Glamour Difficulty-Easy
New issue 654 by damien.c...@gmail.com: [Glamour] Undocumented differences between types of actions http://code.google.com/p/moose-technology/issues/detail?id=654
There are multiple ways to add actions to a presentation:
- using #selectionAct: - using #act:* - using #dynamicActionsOnSelection:
These methods do not have comments that help in distinguishing them. The moose book doesn't present them either.
If you explain them to me, I will write the documentation at the appropriate places.
Updates: Cc: -tudor.gi...@gmail.com tu...@tudorgirba.com
Comment #1 on issue 654 by tu...@tudorgirba.com: [Glamour] Undocumented differences between types of actions http://code.google.com/p/moose-technology/issues/detail?id=654
Thanks for looking into this. Indeed it would be great to document them.
I added the following explanations to the Moose book. Is it clearer now?
--- http://www.themoosebook.org/book/internals/glamour/actions
There are several kinds of actions supported by Glamour. First, there are actions that are supposed to work for the entire presentation, and actions that are meant to work only contextually when there is a selection. These are specified using the following messages:
- the act:* messages define actions for the entire presentation. These actions are typically rendered in the toolbar from the top-right of the presentation. - the selectionAct:* messages define actions that should be active only when there is a selection. These actions are typically mapped on the contextual menu. The above messages define static actions. That means that regardless of what the values of the ports are, these actions will always be available. However, at times, we can also decide to provide actions dynamically depending on the port values. This can be achieved through dynamicActions: and dynamicActionsOnSelection: messages. These messages receive a block that will be evaluated on the presentation and should return a list of GLMAction objects.
These messages are meant to be used as a last result because they work with the internals of Glamour.
Updates: Status: Fixed
Comment #2 on issue 654 by damien.c...@gmail.com: [Glamour] Undocumented differences between types of actions http://code.google.com/p/moose-technology/issues/detail?id=654
Much clearer thank you. I just don't get the last note:
" These messages are meant to be used as a last result because they work with the internals of Glamour. "
Comment #3 on issue 654 by tu...@tudorgirba.com: [Glamour] Undocumented differences between types of actions http://code.google.com/p/moose-technology/issues/detail?id=654
It means that ideally, this mechanism should be replaced by some nicer API. Basically, now you have to instantiate the GLMAction in the block and manually create a list. I do not particularly like that :). So, I thought that we should warn people that this might change.