LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Adjusting control from second thread

Hi all,
 
I am using an asynchronous timer to change images in a tree control:
 
SetTreeItemAttribute (pnlHandle, PNL_TREE, item, ATTR_IMAGE_INDEX, image_index);
ProcessDrawEvents ();
 
Unfortunately, I do not see any image changing. I suppose that it is not possible to change a control's attribute in another thread than where this control was created/loaded, only a control's value (since I don't have any problem updating a textbox using the SetCtrlVal function).
 
Is there any easy way to get around this problem?
0 Kudos
Message 1 of 2
(2,963 Views)

Wim,

Actually, it is possible to change a control's attribute in a different thread. However, to see the effects of the attribute change, you have to process events in the thread where the control was created/loaded. So, the problem is in the ProcessDrawEvents, which is not going to have any effect in the async timer function. Is it possible for you to signal the main thread in order to process events there?

Luis

0 Kudos
Message 2 of 2
(2,958 Views)