Jump to content

Tree Control heirarchial structure string


Recommended Posts

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?

Link to comment

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

Link to comment

QUOTE (Norm Kirchner @ Sep 3 2008, 10:31 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.

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.