Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Dynamically updating a PtMultiText widget: Page 1 of 3 (3 Items)
   
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);
}