Ben Coman wrote:
I am trying to combine interactions with subviews in Mondrian but it is not working as expected. This is with a fresh Moose 4.6 downloaded today plus ConfigurationOfMondrian (AlexandreBergel.345) and [ ConfigurationOfMondrian project lastVersion load ].
As a test case, from ( World > Moose > Mondrian Easel ) I combine: Examples > interaction > variation in node size Examples > subviews > simple to produce the following example:
----8<----- view nodes: (1 to: 5) forEach: [:each | view interaction strongHighlightWhenOver: [ :v | v ]. view shape rectangle withText; size: 20. view nodes: (1 to: each). view gridLayout ]. ----8<----- However executing this in Mondrian Easel you will notice that (taking for example the third group) hovering over small squares 1 & 2 does not highlight these and hovering over small square 3 highlights the large square rather than its small square.
I get my expected/required behaviour by modifying MOAnnouncer>>registerForEvent: forNodes: updateShape: updateLayout: to replace... domainNodes := (aBlockOrSymbol moValue: ann element model). nodes := ann viewRenderer nodeForDomainValues: domainNodes. by... nodes := OrderedCollection new add: ann element ; yourself.
...but I don't know what else that breaks or another way to get my required behaviour. How should I proceed?
cheers, -ben _______________________________________________
A few additional side comments...
1. Before the above change, on the Mondrian tests TestRunner produces 37 run, 37 passes and after the above change also produces 37 run, 37 passes.
2. Two other interesting variations of my test case that I had played with: ----8<----- "This highlights the large square when hovering over it but turns off when hovering over the small squares." view interaction strongHighlightWhenOver: [ :v | v ]. view nodes: (1 to: 5) forEach: [:each | view shape rectangle withText; size: 20. view nodes: (1 to: each). view gridLayout ]. ----8<----- "This highlights the large square when hovering over it and also when hovering over the small squares." view interaction strongHighlightWhenOver: [ :v | v ]. view nodes: (1 to: 5) forEach: [:each | view interaction forward. view shape rectangle withText; size: 20. view nodes: (1 to: each). view gridLayout ]. ----8<-----
3. If in my examples above, instead of... view interaction strongHighlightWhenOver: [ :v | v ] you debug with... view interaction strongHighlightWhenOver: [ :v | self halt. v ] then tracing through the line nodes := ann viewRenderer nodeForDomainValues: domainNodes. produces 'MessageNotUnderstood: receiver of "nodeForDomainValues:" is nil' where 'ann viewRenderer' returns nil.
cheers, -ben