Page 1 of 1

Tree view question

Posted: Wed Nov 01, 2023 9:12 pm
by Fjord
Hi,
I'm using a Tree View control to display a tree structure but I'm running into a problem: data can be associated with tree 'leaves' but [apparently] not to tree 'nodes'. Just to make myself clear:

Code: Select all

   put "1" into p["first label"]
   put "2" into p["second label"]
   put "2.1" into p["second label"]["first sublabel of second label"]
   put "2.2" into p["second label"]["second sublabel of second label"]
   set the arrayData of widget "tv2" to p
gives the following tree
Image
So, the line with 'second label' with data = 2 does not appear. Also, I can get an 'actionDoubleClick' message when I click on the leaves (#1, 2.1 & 2.2) but not on #2

Re: Tree view question

Posted: Wed Nov 01, 2023 9:15 pm
by Fjord
(cont'd)
I want to associate data to the nodes (like '2). Did I miss something? or is it impossible with the widget Tree View? meaning I would have to design my own solution with a field.

Re: Tree view question

Posted: Thu Nov 02, 2023 1:31 am
by bwmilby
You are not missing anything. The sub-array is the value. You can’t have both a scalar value and a sub-array value.