Display two message one after another in a label in single event

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

 

Hi,

My form contains scroll window with two label's to display error and status message and  two buttons i.e, "Generate" and "Cancel".

Whenever I click on "Generate" buttons I have to get a status message saying "Kit generate process is in Progress" and when the process is complete display a message in same status label saying "Kit Is Created Successfully." and return from the event. This whole process is happening in a single event. The issue is application is giving  the last message in the status label before the return from the event . No intermediate messages are being displayed.

Code Snippet:

Below is the code snippet for "Generate" Buttons.

//The below method is to register the application callbacks for "Cancel" and "Generate" Button Form Elements.

Logical CreateDbKit::register_application_callbacks( )

{

    bool status = dispatch.map( fe_Cancel, &CreateDbKit::KitCancel )

               && dispatch.map( fe_Generate, &CreateDbKit::Generate );

    return status;

}

 

//This method is called when the user clicks on the Generate button.

 

Logical CreateDbKit::Generate( const FormEvent& event )

{

   bool status = true;

   _errormsg = "Kit Is Created Successfully.";

  message( format_msg( KitInProgress ) ); -----------------------------------> Not being printed In the status label

  message( format_msg( KitGenerated, _errormsg.c_str( ) ) ); ----------> Only final message is being printed in the status label

  unlock();

return status;

}

End Code Snippet:

Below are the lists of approaches tried so far. But no luck.

 

1)  Adding sleep(10) in between two message like below.

 

   message( format_msg( KitInProgress ) ); -----------------------------------> Not being printed In the status label

   sleep(10);

  message( format_msg( KitGenerated, _errormsg.c_str( ) ) ); ----------> Only final message is being printed in the status label

 

2) Calling extra "message(...)" function call like below.

     

  message( format_msg( KitInProgress ) ); ------------------------------------> Not being printed In the status label

  sleep(10);

  _errormsg = "Kit Created Failed.";

  message( format_msg( KitGenFailed, _errormsg.c_str( ) ) ); ----------> Still not being printed In the status label

  sleep(10);

  message( format_msg( KitGenerated, _errormsg.c_str( ) ) ); ----------> Only final message is being printed in the status label

 

3) If I call This function i.e "graph_db->process_pending_events( );" in between every messages then it works for 2-3 times then only.like Below.

     

    message( format_msg( KitInProgress ) ); ------------------------------------> printed In the status label only 2-3 times then only.

    graph_db->process_pending_events( );

  _errormsg = "Kit Created Failed.";

  message( format_msg( KitGenFailed, _errormsg.c_str( ) ) ); ----------> Still not being printed In the status label

  graph_db->process_pending_events( );

  message( format_msg( KitGenerated, _errormsg.c_str( ) ) ); ----------> Only final message is being printed in the status label

     

  Definition of this function is below:

 

  inline void Graphic_DB::process_pending_events( ) 

 {

     XtInputMask input_mask;

    while ( (input_mask = XtAppPending( Graphic_DB::app_context )) )

    {

        XtAppProcessEvent( Graphic_DB::app_context, input_mask );

    }

}

 

Please Please Advise me, as I am very new to this Motif world.

Thu, 02/07/2013 - 03:44
#1
2 posts / 0 new
Last post
-8
Thu, 06/27/2013 - 09:34