Status: Accepted Owner: damien.c...@gmail.com Labels: Type-Defect Priority-Medium Component-Glamour
New issue 653 by damien.c...@gmail.com: [Glamour] GLMBasicExamples>>staticAndDynamicMenu presents not working actions http://code.google.com/p/moose-technology/issues/detail?id=653
0) open a transcript 1) execute: 'GLMBasicExamples open' 2) select 'Menus' (this is populated by the #staticAndDynamicMenu method) 3) go to the 'Text' tab 4) select some text (e.g., 'Character') 5) right click on the text and choose 'Print selection'
you would expect 'Character' to be printed but 'nil' is printed instead. If you then go to the 'List' tab, select a letter and repeat the process from step 3, you will get this letter printed in the transcript. I would have expected the selected text to be printed.
Updates: Status: Verified
Comment #1 on issue 653 by damien.c...@gmail.com: [Glamour] GLMBasicExamples>>staticAndDynamicMenu presents not working actions http://code.google.com/p/moose-technology/issues/detail?id=653
Name: Glamour-Examples-DamienCassou.187 Author: DamienCassou Time: 26 June 2011, 12:47:50 pm UUID: d81f2303-5ccd-4bd8-b3c1-460d6d8b282c Ancestors: Glamour-Examples-cyrilledelaunay.186
- Issue 653: displays the selected text in the transcript, not the result of the #selection port
Comment #2 on issue 653 by damien.c...@gmail.com: [Glamour] GLMBasicExamples>>staticAndDynamicMenu presents not working actions http://code.google.com/p/moose-technology/issues/detail?id=653
Ok, I fixed it by changing the action from
dynamicActionsOnSelection: [:text | ... action: [Transcript show: text selection]; ... ];
to
dynamicActionsOnSelection: [:text | ... action: [Transcript show: text selectedText]; ... ];
However, I'm not sure about the behavior of #selection which currently returns what is selected in the list presentation instead of the text presentation. Please check this before closing the report.
Updates: Cc: tudor.gi...@gmail.com cy.delau...@gmail.com
Comment #3 on issue 653 by damien.c...@gmail.com: [Glamour] GLMBasicExamples>>staticAndDynamicMenu presents not working actions http://code.google.com/p/moose-technology/issues/detail?id=653
(No comment was entered for this change.)
Comment #4 on issue 653 by tu...@tudorgirba.com: [Glamour] GLMBasicExamples>>staticAndDynamicMenu presents not working actions http://code.google.com/p/moose-technology/issues/detail?id=653
A TextPresentation does not populate the #selection port automatically. The reason is that typically, the #selection port is used as a shortcut to connect two panes, but in the case of a text presentation we typically want to select a piece of text and trigger some action based on it. Thus from a usability point of view, it is not the selection that should trigger the population of #selection, but the action.
This is why we populate #selectionText by default.
Does this help?
Updates: Status: Fixed
Comment #5 on issue 653 by damien.c...@gmail.com: [Glamour] GLMBasicExamples>>staticAndDynamicMenu presents not working actions http://code.google.com/p/moose-technology/issues/detail?id=653
Helps a lot. So I guess my fix was correct in replacing #selection by #selectedText. I close the issue.