My original example below was a little artificial in order to be concise. It actually stemmed from not quite grasping the architecture of Mondrian (which has evolved in the last couple of days) and was equivalent to bypassing the line (view node: self) below. I had been going...
MyContainerClass>>addSubViewTo: view
view node: self.
view forNode: self do: [...]
I had not yet discovered #node:forIt: and it suites much better. Thanks.
btw, I had taken the use of #forNode:do: from World > Mondrian Easel > Examples > subviews > add subview
which makes it look like an external method, as well as it not being in the 'private' method category of MOViewRenderer.
Is there another way to do that example with external methods?
cheers, -ben
Tudor Girba wrote:
Hi,
forNode:do: is an internal method. You should use node:forIt: or nodes:forEach: to construct nested graphs.
Cheers,
Doru
On 23 Mar 2012, at 15:26, Ben Coman wrote:
Background:
I am trying to use Mondrian to visualize SomeContainerClass holding SomeOtherContainerClass that holds Equipment classes. So I was thinking each container class might have a method (#subviewOf: aView) which at some point does (aView forNode: self do:). Now I have come to the understanding that I am probably misusing #forNode:do: like that, and am continuing exploring that, but thought I would report the MNU that I encountered before moving on - just in case it was desirable to guard against such abuse.
Steps to Reproduce:
The essence of this distills down to the following in Mondrian Easel, where this first case works....
view nodes: (1 to: 20).
view forNode: 2 do: [ view nodes: (50 to: 52) ]
but this second case...
view nodes: (1 to: 20).
view forNode: view do: [ view nodes: (50 to: 52) ]
gets MNU "removeAllEdges"
Inserting 'self halt' between the two lines and tracing through to MONode>>nodeWith:ifAbsent shows the line...
nodeLookedUp := self nodes detect: [:each | each model = anObject ] ifNone: aBlock.
has in the first case (self nodes) as anOrderedCollection of 20 items
and in the second (self nodes) is an empty Array.
Just reporting for discussion. I am not sure if this would be considered a bug worth tracking, or just an abuse of the framework.
Cheers, Ben
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Value is always contextual."
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev