Kendall Russell
|
Dynamically updating a PtMultiText widget
|
Kendall Russell
06/29/2011 6:25 PM
post86955
|
Dynamically updating a PtMultiText widget
My application has an option to display status messages while it is processing data.
I am attempting to update a PtMultiText widget for each status point in the process.
It isn't working. Nothing is displayed in the PtMultiText widget until the process has completed and then it is only
the last string, not all of them.
Basically, here is the flow and the code that sets the PtMultiText widget.
void ProcessData()
{
//UPDATE THE USER
AppendMessage("The Process has started\n");
//DO WORK
...
//UPDATE THE USER
AppendMessage("The Process is 33% done\n");
//MORE WORK
...
//UPDATE THE USER
AppendMessage("The Process is 66% done\n");
etc...
//FINAL UPDATE
AppendMessage("The Process is done.\n");
}
void AppendMessage(const char* const pszInMsg)
{
char szFullMsg[8192+1] = {0};
char* pszCurMsg = 0;
//GET CURRENT TEXT
PtGetResource(ABW_MultiTxtMsg, Pt_ARG_TEXT_STRING, &pszCurMsg, 0);
//MERGE BOTH TEXT VALUES
sprintf(szFullMsg, "%s %s", pszCurMsg, pszInMsg)
//SET NEW TEXT
PtSetResource(ABW_MultiTxtMsg, Pt_ARG_TEXT_STRING, szFullMsg, 0);
}
|
|
|