LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

panel refresh problem..

Help me..
we are using a panel to show the elapsed time of a background running task, we are updating the time elapsed in a thread, everything is good when there is no critical task running in the main thread, but if some thing with delays running in the task the text box used to display the time elapsed in the panel is becoming white and nothing is displayed in it.
we tried refreshing the panel with again using the DisplayPanbel() function but no use..
help me
0 Kudos
Message 1 of 6
(4,800 Views)
I assume you're updating the textbox from your background thread, and what you're seeing is that the textbox is not updating until your main thread finishes its time critical task.

This is probably happening because of the way in which you're drawing to the text box. You might want to read through this thread for a discussion of how different types of UI actions affect threads that are not processing events. The bottom line is that if you use the SetCtrlVal to update the textbox, you should be able to see the textbox update even while its thread is blocked. See the attached program for an example. In this same attached program, if you replace SetCtrlVal with InsertTextBoxLine, for example, you'll notice that the textbox will not update until its thread is free to process events.

Hope this helps.

Luis
0 Kudos
Message 2 of 6
(4,794 Views)
thanks for u r detailed explanation Luis,
but here we are using SetCtrlVal function only to update the textbox.
give me some suggestions that may be making the text box not refreshing.
0 Kudos
Message 3 of 6
(4,776 Views)
Hi Satya,

I'm not sure why you're seeing that behavior but you could try doing a ProcessDrawEvents or a ProcessSystemEvents call to see if that refreshes the display.
Test Engineer - CTA
0 Kudos
Message 4 of 6
(4,752 Views)
I don't know... I'd have to actually have a test program that reproduces the behavior, in order to inspect it.

If you can't attach a small, modified version of your program here, I'd recommend starting with the small sample that I attached earlier and make sure that when you run it, it refreshes the textbox. If it does, then you could gradually start combining the two programs until you can see what the relevant difference is. Once you know what it is, you can post it here, and we can then find out if there's some possible workaround.

Luis
0 Kudos
Message 5 of 6
(4,751 Views)
Hi All,
That panle rerfresh problem is solved.
i think that the problem is because the panel is loaded in the main thread and as main thread is busy in doing the critical task it is not refreshing. now we are loading the panel in the sub theread and also updating that in that thread itself, so its good now.
thanks for the ur support.
Regards,
Satya
 
0 Kudos
Message 6 of 6
(4,719 Views)