LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GUI that does not update when setting a tab control (EasyTab) attribute

Hello,
 
I have a canva control on my main panel, converted into a Tab control with the function EasyTab_ConvertFromCanvas().
I added my tabs with the EasyTab_AddPanels() function.
 
I want to set the active tab using following code:
EasyTab_SetAttribute (main_panel, TabCtrl, ATTR_EASY_TAB_ACTIVE_PANEL, graph_tab);
 
The problem is that the user interface is only updated a long time after this code line is called.
That is to say, too late!
 
I tried sevral things, also calling the function ProcessDrawEvents() just after this code line, it didn't help.
 
Please, could any body help?
 
 
 
 
0 Kudos
Message 1 of 5
(3,417 Views)
Normally ProcessDrawEvents should work. Maybe you have parallel threads that keep CVI bussy in the background? Or are there a a lot of elemnts on the Tab you want to activate that have to be initialized with some data for example ?
You could try ProcessSystemEvents instead of ProcessDraEvents, too.
0 Kudos
Message 2 of 5
(3,415 Views)
Hello André,
 
The Tab I want to activate contains one to three graphs and some buttons, but they are not sollicited before the activation call.
I have a Timer Control that updates continuously one LED (not on the tab control), is that what you mean with thread?

The LabWindows help says that ProcessSystemEvents should be used carefully, and I wouldn't like the application to crash because the user has clicked somewhere during the function execution were the GUI has to be updated. Is there another solution?

 
0 Kudos
Message 3 of 5
(3,412 Views)

Try putting the ProcessSystemEvents() call at the end of your timer callback routine. I have found that if the timer callback takes so long to execute that the next timer tick occurs before the function ends, it will immediately be re-entered without the GUI being updated. By including the ProcessSystemEvents() within the callback this will guarantee that the GUI servicing will be performed, even if the timer callback intervals are set to 0.

JR

0 Kudos
Message 4 of 5
(3,403 Views)
Sorry, I have forgotten, my Timer Control is disabled a while before the activation call.
 
I tried with ProcessSytemEvents after the activation instead of ProcessDrawEvents, but it is NOT a viable solution for my application, as the action where this Tab activation is done, has to continue executing and the user should not be able to click a button or pull down a menu during that time.
 
And as said in LabWindows help: ProcessSystemEvents should be used carefully... Do not call ProcessSystemEvents in your program if you want to continue executing the subsequent lines of code even during tracking loop.
 
So what can I do so that my GUI is updated, and my code keeps on running without user interaction until the function finishes?
 
Please help!
0 Kudos
Message 5 of 5
(3,376 Views)