Michael Hill Posted September 4, 2008 Report Share Posted September 4, 2008 I'm trying to create a user interface for a data acquisition system I am working on. I thought a tree control would be the best way to visualize our DAQ system (see what crates belong to what computers and what cards belong to what crates). It is structured in this manner: - Blade 1 ---Crate 1 -----Slot 0 -----Slot 1 -----Slot 2 -----Slot 3 -----Slot 4 -----Slot 5 -----Slot 6 -----Slot 7 ---Crate 2 ---Crate 3 +Blade 2 +Blade 3 etc... I would really like to be able to select "Slot 4" From crate 1 in Blade 1 and have it return the string "Blade 1\Crate 1\Slot 4" I have been messing with property nodes for a couple days, but all I have been able to do was return "Slot 4" but none of the parents. How can this be done? Quote Link to comment
Norm Kirchner Posted September 4, 2008 Report Share Posted September 4, 2008 There are some key things to know about the tree control. Each element has a string tag associated with it. This tag does not have to have any resemblance to the displayed value. As you add an element into your tree, set the string and the tag. The tag will be your path and the name will be what's displayed. As someone selects part of the tree, the data value of the control is the selected tag .... ie your path I strongly suggest checking out the Tree Control API as it will get you out of property node hell and back into the LV we love so dear. I have a full presentation on working with the tree control.... Lemme go dig it out for you Found it here! keep the questions coming Quote Link to comment
Michael Hill Posted September 4, 2008 Author Report Share Posted September 4, 2008 QUOTE (Norm Kirchner @ Sep 3 2008, 10:31 AM) There are some key things to know about the tree control.Each element has a string tag associated with it. This tag does not have to have any resemblance to the displayed value. As you add an element into your tree, set the string and the tag. The tag will be your path and the name will be what's displayed. As someone selects part of the tree, the data value of the control is the selected tag .... ie your path I strongly suggest checking out the Tree Control API as it will get you out of property node hell and back into the LV we love so dear. I have a full presentation on working with the tree control.... Lemme go dig it out for you Found it here! keep the questions coming Actually, I believe I just found what I was looking for after making this topic (who wouldda thunk?). There is an invoke node that allows you to return an array of the hierarchy. I was looking in the wrong spot all along. Thanks, though. Quote Link to comment
Norm Kirchner Posted September 4, 2008 Report Share Posted September 4, 2008 QUOTE (Michael Hill @ Sep 3 2008, 09:36 AM) Actually, I believe I just found what I was looking for after making this topic (who wouldda thunk?). There is an invoke node that allows you to return an array of the hierarchy. I was looking in the wrong spot all along. Thanks, though. This is not what you want to be doing. From a programmers standpoint, the tag is the appropriate place for this especially if that is the information you are looking to extract from someones selection. Also even if you keep w/ your solution, still look into the API. It makes life sooo much easier for you and the next guy walking up to your program. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.