The example from my previous post works fine if the three lines below
marked "for Part Two" are left commented - but uncomment them, then
execute and on node2 select 'Explore graphic element' from the context
menu, you get a MNU ROEdge>>elementFromModel:
This occurs since the instance variable 'elements' in ROView &
ROElement holds both ROElement & ROEdge.
I know I'm poking around in the internals of Roassal where decent
applications should fear to tread ;) so I'm not sure if this is a
dormant bug waiting to bite someone, or has guards elsewhere that I've
bypassed.
cheers -ben
Ben Coman wrote:
I have split this post into two parts since I think
any follow up will
form two distinct threads.
As I am developing using Roassal, I find it useful to Explore the
graphic elements from a context menu. To demonstrate I have adapted
ROExample>>linesOn:
"-------------"
"-------------"
menu := (ROMenuActivable new)
item: 'Explore graphic element' action: [ :model | (rawView
elementFromModel: model) explore ].
node1 := ROLabel elementOn: 'node1'.
node2 := ROLabel elementOn: 'node2'.
node1 @ RODraggable @ menu.
node2 @ RODraggable @ menu.
"uncomment next three lines for Part Two
edge := ROEdge lineFrom: node1 to: node2.
edge + (ROLine red).
rawView add: edge.
"
rawView add: node1; add: node2.
ROHorizontalLineLayout on: (Array with: node1 with: node2).
"-------------"
"-------------"
Is there (or can there be added) a way to access the graphic element
more directly? Something like one of the following two lines...
item: 'Explore graphic element' action: [ :model :element | element
explore ].
item: 'Explore graphic element' rawAction: [ :element | element
explore ].
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev