View Single Post
Old 02-04-2016, 04:11 AM
Erikvdb Erikvdb is offline
Join Date: May 2013
Posts: 63
Highlighter works, you just need to declare the sub-nodes as objects.

gallery = viz.addChild('gallery.ive')
nodes = {}

for name in gallery.getNodeNames():
    node = gallery.getChild(name) #create child object
    nodes[node] = name #store in dict with its name

from tools import highlighter
tool = highlighter.Highlighter()

def onHighlight(e):
    if in nodes:
        print '{} is highlighted'.format(nodes[])

There might be an easier way to get the node name from the selected object so you don't need to store it in a dictionary, but hey.
Reply With Quote