[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

3103.0. "Work procedure and label question" by SWTHOM::TISSERAND (Jean-Marc TISSERAND TSC FRANCE) Fri Jul 20 1990 07:57

Hi,

I have a strange problem using work procedure.

In a activate push button callback, I manage a message box and add a work 
procedure. In this procedure, I sleep for 5 seconds and then unmanage the
message box. 

It works fine, except that the message box labels do not appear.
The message box displays 5 seconds (but without label and push button)
 and disappears.

If I only manage the message box in the callback, it works fine. 

Any idea ?

Thanks for your help.
Jean-Marc.

T.RTitleUserPersonal
Name
DateLines
3103.1XtAddTimeOutRAB::PRINCIPIOFri Jul 20 1990 09:104
Because you are sleeping in the work procedure, you are not processing events. 
I suggest you try XtAddTimeOut instead.

Tracy
3103.2Thanks, but ...SWTHOM::TISSERANDJean-Marc TISSERAND TSC FRANCEFri Jul 20 1990 10:5118
Yes, but before I execute the work procedure, I go into Xtmainloop and there's 
an event generated by xtmanagechild(message_box). 

I use the work procedure because I have to make a message box appear for only 
5 seconds. If I manage and unmanage the message box in the callback, the message
box appears only at the end of the callback and then immediately disappears. 
It's a normal behavior because no events are processed during the callback.

Assume that instead of waiting 5 seconds, I do some work that takes 5 seconds in 
the work procedure.
Can I use xtaddtimeout in this case ?

How can I do it ?  ( Using a mini-xtmainloop in the work procedure to handle 
events ? ).

Thanks 
Jean-Marc.

3103.3STKMKT::SWEENEYOnline and Out of BoundsFri Jul 20 1990 14:429
    In a callback
    	manage the message box
    	add the work procedure
    
    In the work procedure
    	work for 5 seconds
    	unmanage the message box
    
    (This scheme doesn't let the user cancel the work procedure)
3103.4Don't stretch callbacks or workprocs > .25 secTOOLEY::B_WACKERFri Jul 20 1990 14:474
No callback should last over .25 seconds, see Guide to Application 
Programming 2.8.4.  Do the unmanage in the timeout callback.

Bruce