XtAppMainLoop man page on HP-UX

Man page or keyword search:  
man Server   10987 pages
apropos Keyword Search (all sections)
Output format
HP-UX logo
[printable version]

XtAppMainLoop()						       XtAppMainLoop()

Name
  XtAppMainLoop - continuously process events.

Synopsis
  void XtAppMainLoop(app_context)
	 XtAppContext app_context;

Inputs
  app_context
	    Specifies  the application context that identifies the appli‐
	    cation.

Returns
  XtAppMainLoop() enters an infinite loop and never returns.

Description
  XtAppMainLoop() enters an infinite loop which calls XtAppNextEvent() to
  wait for an events on all displays in app_context and XtDispatchEvent()
  to dispatch that event to the appropriate code.

Usage
  Most applications will call XtAppNextEvent() as the last line of  their
  main()  procedure.  Some applications may provide their own versions of
  this loop, however.  A custom event loop  might  test	 an  application-
  dependent  global  flag  or  other termination condition before looping
  back and calling XtAppNextEvent().  If the number of top-level  widgets
  drops to zero, the application may be able to exit safely, for example.

  Applications	that use multiple application contexts or that use inter‐
  nal event loops will have to build their own event loop.

Background
  XtAppNextEvent() looks for X events in the input queue, and  also  han‐
  dles	timer  events  (see  XtAppAddTimeOut()) and events from alternate
  input sources (see XtAppAddInput()).	If none of these events are pend‐
  ing and a work procedure (see XtAppAddWorkProc()) is registered, XtApp‐
  NextEvent() invokes that work procedure to  do  background  processing,
  otherwise  it	 blocks waiting for an event.  Note that XtAppNextEvent()
  dispatches timer and input events directly, but returns  any	X  events
  that	occur.	 Within XtAppMainLoop(), these X events are always passed
  to XtDispatchEvent().

  XtDispatchEvent() dispatches an event to the appropriate event handlers
  (see XtAddEventHandler()).  Note that the translation manager registers
  an event handler, and that events that are dispatched to  the	 transla‐
  tion	manager	 will  be further dispatched through the translations-to-
  actions mechanism.

Example
  XtAppMainLoop() is implemented as follows:

     void XtAppMainLoop(app)
	     XtAppContext app;
     {
	 XEvent event;

	 for (;;) {
	     XtAppNextEvent(app, &event);
	     XtDispatchEvent(&event);
	 }
     }

See Also
  XtAddEventHandler(1), XtAppAddInput(1), XtAppAddTimeOut(1), XtAppAd‐
  dWorkProc(1), XtAppNextEvent(1), XtAppProcessEvent(1), XtDis‐
  patchEvent(1).

Xt - Event Handling					       XtAppMainLoop()
[top]

List of man pages available for HP-UX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net