LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

no update from textbox with inserttextboxline or resettextbox command

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.

0 Kudos
Message 1 of 9
(5,287 Views)

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?

0 Kudos
Message 2 of 9
(5,283 Views)

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;
}

0 Kudos
Message 3 of 9
(5,280 Views)

If I add a line "Delay (10.0);" after inserttextboxline line, the panel textbox update will happen after the 10 seconds delay.

0 Kudos
Message 4 of 9
(5,278 Views)

@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

0 Kudos
Message 5 of 9
(5,276 Views)

Yes, that fixed the problem.

 

Thanks a lot, Wolfgang!

0 Kudos
Message 6 of 9
(5,272 Views)

Call ProcessDrawEvents() right after the insertion.

0 Kudos
Message 7 of 9
(5,246 Views)

Yes, that is what Wolfgang's link recommends.

 

Thanks.

0 Kudos
Message 8 of 9
(5,241 Views)

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.

0 Kudos
Message 9 of 9
(5,239 Views)