Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xtappaddworkproc(3xt) [ultrix man page]

XtAppAddWorkProc(3Xt)						     MIT X11R4						     XtAppAddWorkProc(3Xt)

Name
       XtAppAddWorkProc, XtRemoveWorkProc - Add and remove background processing procedures

Syntax
       XtWorkProcId XtAppAddWorkProc(app_context, proc, client_data)
	  XtAppContext app_context;
	  XtWorkProc proc;
	  XtPointer client_data;

       void XtRemoveWorkProc(id)
	  XtWorkProcId id;

Arguments
       app_context
		 Specifies the application context that identifies the application.

       client_data
		 Specifies the argument that is to be passed to the specified procedure when it is called.

       proc	 Specifies the procedure that is.

       id	 Specifies which work procedure to remove.

Description
       The function adds the specified work procedure for the application identified by app_context.

       The function explicitly removes the specified background work procedure.

See Also
       XtAppNextEvent(3Xt)
       X Window System Toolkit: The Complete Programmer's Guide and Specification, Paul J. Asente and Ralph Swick
       X Window System: The Complete Reference, Second Edition, Robert W. Scheifler and James Gettys

															     XtAppAddWorkProc(3Xt)

Check Out this Related Man Page

XtAppAddWorkProc()														XtAppAddWorkProc()

XtAppAddWorkProc - register a procedure to be called when the event loop is idle.

Synopsis
  XtWorkProcId XtAppAddWorkProc(app_context, proc, client_data)
	 XtAppContext app_context;
	 XtWorkProc proc;
	 XtPointer client_data;

Inputs
  app_context
	    Specifies the application context.

  proc	    Specifies the procedure that is to be called when the application is idle.

  client_data
	    Specifies data to be passed to proc when it is called.

Returns
  A handle of type XtWorkProcId that can be passed to XtRemoveWorkProc() to unregister the work procedure.

Description
  XtAddWorkProc()  registers  the  procedure proc and the data client_data to be called by XtAppNextEvent() or XtAppProcessEvent() when there
  are no pending input events and it would otherwise block.  Multiple work procedures can be registered, and the most recently added  one  is
  always  the  one  that  is called.  However, if a work procedure itself adds another work procedure, the newly added one has lower priority
  than the current one.

  A work procedure returns a Boolean.  If it returns True, it will automatically be unregistered and will not be called again.	If it returns
  False it will be called the next time the application is idle.  See XtWorkProc(2) for more information.

Usage
  XtAppAddWorkProc() implements a limited form of background processing.  Most applications spend most of their time waiting for input; to do
  useful work during this idle time, you can register a work procedure that will run when the application is idle.

  A work procedure must return quickly or the application will not be able to promptly respond to user events.	If a large task needs  to  be
  done	in  the background, the work procedure should periodically save its state and return False.  Work procedures should not be used to do
  frivolous work in the background.  In a multi-tasking system, an idle application should generally actually be idle, and not steal CPU time
  from other processes.

  A work procedure can be explicitly removed by calling XtRemoveWorkProc() with the XtWorkProcId returned by this function.

Structures
  The XtWorkProcId type is defined as follows:

     typedef unsigned long XtWorkProcId;

See Also
  XtAppNextEvent(1), XtAppProcessEvent(1), XtRemoveWorkProc(1),
  XtWorkProc(2).

Xt - Event Handling														XtAppAddWorkProc()
Man Page