03-04-2014 12:52 PM
Maybe there is an attribute to configure. After a command with inserttextbox or resettextbox, there is no update on the textbox display. But if I run displaypanel again, the new text shows up in the textbox. Why the response of textbox is delayed or skipped?
Thanks,
Jie.
03-04-2014 01:05 PM
Can you provide some more information, e.g., the code of your function call or if you call InsertTextBoxLine within a callback routine ...
Did you try (and inspect) the example textbox.cws shipping with CVI?
03-04-2014 01:22 PM
I ran textbox.cws with debug mode step by step using breakpoint. After inserttextboxline command is finished, there is no update in the textbox (no line is inserted). After the whole callback function is done, the update is then shown in the textbox. Could you please try?
int CVICALLBACK InsertCallback (int panel, int control, int event,
void *callbackData, int eventData1,
int eventData2)
{
if (event == EVENT_COMMIT)
{
g_lineCount++;
InsertTextBoxLine (panel, PANEL_ACTIONBOX, 0,
"This line is inserted at index 0 (at the top)");
}
return 0;
}
03-04-2014 01:29 PM
If I add a line "Delay (10.0);" after inserttextboxline line, the panel textbox update will happen after the 10 seconds delay.
03-04-2014 01:38 PM
@jzhu0000 wrote:
I ran textbox.cws with debug mode step by step using breakpoint. After inserttextboxline command is finished, there is no update in the textbox (no line is inserted). After the whole callback function is done, the update is then shown in the textbox.
That's what I would have expected...see here
03-04-2014 01:46 PM
Yes, that fixed the problem.
Thanks a lot, Wolfgang!
03-05-2014 03:34 PM
Call ProcessDrawEvents() right after the insertion.
03-05-2014 03:38 PM
Yes, that is what Wolfgang's link recommends.
Thanks.
03-05-2014 03:42 PM
Good. Did not see that.
I profusely use ProcessDrawEvents(),. I write applications that typically have several asynchronous threads running. Every time a thread updates some panel controls --buttons, textboxes, strip charts, etc -- ProcessDrawEvents() is called.