LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

EVENT_SORT and tree controls

Solved!
Go to solution

Hi,

 

I have a question about how sorting works with tree controls.  Basically, it appears that when this event is fired in the callback, the items in the tree have not yet been sorted (as seen by calling GetValueFromIndex(...) on the items in the tree).  I'm guessing, looking through the help file and the treeevent example, that this is here so that I can "swallow" a sort event based upon the sorting parameters, which are accessable through the eventData parameters.  This seems reasonable.  However, it appears that the EVENT_SORT is the last event fired when the user does a sort.  So my question is, is there a way to trigger an event after the tree has been sorted in the callback, something like an EVENT_WAS_SORTED?  (I could probably hack something together with a global and a timer or something like that, but is there something more clever I'm missing?)  Thanks.

 

0 Kudos
Message 1 of 3
(2,906 Views)
Solution
Accepted by topic author tstanley

The best way I can think of to accomplish this would be to call PostDefferedCall from the EVENT_SORT event.  We don't document that the tree will be sorted before future events are handled, but in all my testing, this happened to be the case.  I've attached the simple test program I wrote to test this out.

 

NickB

National Instruments

Message 2 of 3
(2,894 Views)

Hi,

 

Thanks for the response.  Your example code does exactly what I need to do and is a better solution than anything I had come up with.  Kudos.

0 Kudos
Message 3 of 3
(2,878 Views)