That is actually a good point.
I think one mistake we did with Mondrian, is to completely hide the nodes in the
interaction. As a consequence, you could not do any interesting interaction beside
#inspect.
I've changed #item:action: now passes the element and not the model. You can have the
following script for example:
view shape rectangle size: 15.
view interaction
item: 'inspect element' action: #inspect;
item: 'inspect model' action: [ :el | el model inspect ];
item: 'browse element class' action: [ :el | el model browse ].
view nodes: (1 to: 5).
In Roassal 1.151
Cheers,
Alexandre
On Sep 30, 2012, at 9:30 AM, Ben Coman <btc(a)openInWorld.com> 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
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.