Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xtapppeekevent(1) [hpux man page]

XtAppPeekEvent()														  XtAppPeekEvent()

Name
  XtAppPeekEvent - return, but do not remove the event at the head of an application's input queue; block if no events are available.

Synopsis
  Boolean XtAppPeekEvent(app_context, event_return)
	 XtAppContext app_context;
	 XEvent *event_return;

Inputs
  app_context
	    Specifies the application context.

Outputs
  event_return
	    Returns the event from the head of the queue, if that event is an X event.

Returns
  True if the event at the head of the queue is an X event; False if it is a timer event or an alternate input source event.

Description
  If  there  are  X  events pending on any of the displays in app_context, XtAppPeekEvent() copies the event from the head of the application
  event queue into event_return (without removing the event from the queue) and returns True.  If there are no events, it flushes the  output
  buffers  of each display and checks again.  If there are still no pending X events on any of the displays, but there are timer or alternate
  input events ready, XtAppPeekEvent() returns False.

  If there are no events of any kind, XtAppPeekEvent() blocks until one occurs, and then if it is an  X  event,  copies  the  event  (without
  removing it from the queue) and returns True or returns False otherwise.  Note that XtAppPeekEvent() never calls background work procedures
  registered with XtAppAddWorkProc() .

Usage
  Programs rarely need this much control over the event dispatching mechanism.	Most programs use XtAppMainLoop().

  If you want to get X events and remove them from the input queue, consider XtAppNextEvent().	 This  function  also  dispatches  timer  and
  alternate input events.

  If  you  want  to check for input events without blocking, use XtAppPending().  This function returns a value that indicates which types of
  events are pending for an application context, or 0 if no events are pending.

See Also
  XtAppMainLoop(1), XtAppNextEvent(1), XtAppPending(1).

Xt - Event Handling														  XtAppPeekEvent()

Check Out this Related Man Page

XtAppNextEvent()														  XtAppNextEvent()

Name
  XtAppNextEvent - dispatch timer and alternate input event and return the next X event.

Synopsis
  void XtAppNextEvent(app_context, event_return)
	 XtAppContext app_context;
	 XEvent *event_return;

Inputs
  app_context Specifies the application context.

Outputs
  event_return
	      Returns the dequeued event structure.

Description
  If  there  is an X event pending on any of the Displays in app_context, XtAppNextEvent() returns that event in event_return.	Otherwise, it
  flushes the X output buffer of each Display, and if there is a background work procedure  registered	(see  XtAppAddWorkProc()),  XtAppNex-
  tEvent()  calls it and starts over by checking for pending events.  If there are no pending events and no work procedures, XtAppNextEvent()
  blocks while waiting for input on any of the Display connections, activity on any of the alternate  input  sources  registered  with	XtAp-
  pAddInput(), or the expiration of any timers registered with XtAppAddTimeOut().

  If there is activity on an alternate input source or if a timeout interval elapses, XtAppNextEvent() calls the callback that was registered
  with the input source or with the timer.  If an X event occurs, XtAppNextEvent() removes that event  from  the  queue  and  returns  it  in
  event_return.

Usage
  Programs  rarely need this much control over the event dispatching mechanism.  Most programs use XtAppMainLoop().  If you want to process a
  single X, input, or timer event, consider XtAppProcessEvent().

See Also
  XtAppAddInput(1), XtAppAddTimeOut(1), XtAppAddWorkProc(1), XtAppMainLoop(1), XtAppPeekEvent(1), XtAppPending(1), XtAppProcessEvent(1),
  XtDispatchEvent(1).

Xt - Event Handling														  XtAppNextEvent()
Man Page

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

removing the last , in a file

hi, I have a file that contains one line with , at the end of it and I want to remove it using sed I tried s/,$//g but it does not work thanks (4 Replies)
Discussion started by: JamesByars
4 Replies

2. Programming

Number of bytes in terminal input queue w/o blocking and consuming?

Hello, everyone. Could someone, please, tell me how to get the number of bytes in the terminal input queue without blocking and without consuming these bytes? I guess it could be called the peek functionality. I've looked at termio tcgetattr() and tcsetattr() functions but could not find... (4 Replies)
Discussion started by: Lucy.Garfeld
4 Replies

3. Shell Programming and Scripting

Count events occured in the same second in awk

Hello to all in forum, I need to count how many events happens within each second for 01 Aug 2013.(because in the sample appears records for 01 Aug and 02 Aug). The output for the input below should be: Desired Output: --> 2 Records --> 1 Record --> 3 Records Input: DEBUG... (5 Replies)
Discussion started by: Ophiuchus
5 Replies