I am trying out rTree as a table of contents display for an ebook.
Things are working well, almost.
I have been unable to to get the "collapse all" script to work at all, and..
I tried to get the left and right arrow keys to collapse and expand the selected node.
I didn't want to interfere with the existing up and down arrow key navigation so I placed the following script into the control.
Code: Select all
on arrowKey theKey
put the hilitedNodeIDs of control "TOCNavigation" into theNodeID
switch (theKey)
case("left")
set the expanded_of_node_ID_[theNodeID] of control "TOCNavigation" to false
break
case("right")
set the expanded_of_node_ID_[theNodeID] of control "TOCNavigation" to true
break
case("up")
pass arrowKey
break
case("down")
pass arrowKey
break
end switch
end arrowKey
However setting the expanded_of_node_ID_[theNodeID] of the control does nothing.
I tried replacing "control "TOCNavigation"" with "me" but this made no difference (nor generated an error).
I also noticed that pressing the left or right arrow keys caused the node being highlighted to change.
For this to occur it implies the arrow keys are being acted on before they hit my handler.
Anyway, any suggestions?
Is there something I need do to the control itself to allow this?
Should I place the script someplace else?
James