How to select next/prev node in script?

This is a forum focused on providing support for rTree

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Locked
lumpo
Posts: 23
Joined: Sat Jan 05, 2008 1:14 pm
Location: Sydney

How to select next/prev node in script?

Post by lumpo » Thu Feb 17, 2011 11:18 pm

HI I'd like to add a script to a next and prev button (that also responds to a key combo) that will move the selection in the tree and (i) send a nodeup (which triggers my scripts) and (ii) actually acts like it has been clicked ie is hilited and the formatting script in mousedown is run.

At the moment I can get different nodes to be 'worked on' in script but can't get the hiliting etc of the new node.

Thanks for any advice

wilstrand
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Mon Jan 03, 2011 3:02 pm
Contact:

Re: How to select next/prev node in script?

Post by wilstrand » Fri Feb 18, 2011 4:49 pm

Hi Lumpo!

To hilite a node you can use the hilitedNodeIDs Tree property. Just set this property to the ID of the node that you want to select. It is not necessary to refresh the Tree. A script could look like this:

Code: Select all

on nodeUp theButton theNodeID
   set the hilitedNodeIDs of me to 7
end nodeUp
With my best regards

Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects

Locked

Return to “rTree”