*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> Tk/crtgenhdlr (3)              
Title
Content
Arch
Section
 

Contents


Tk_CreateGenericHandler(3Tk)			  Tk_CreateGenericHandler(3Tk)


NAME    [Toc]    [Back]

     Tk_CreateGenericHandler, Tk_DeleteGenericHandler -	associate procedure
     callback with all X events

SYNOPSIS    [Toc]    [Back]

     #include <tk.h>

     Tk_CreateGenericHandler(proc, clientData)

     Tk_DeleteGenericHandler(proc, clientData)

ARGUMENTS    [Toc]    [Back]

     Tk_GenericProc   *proc	   (in)	     Procedure to invoke whenever any
					     X event occurs on any display.

     ClientData	      clientData   (in)	     Arbitrary one-word	value to pass
					     to	proc.

DESCRIPTION    [Toc]    [Back]

     Tk_CreateGenericHandler arranges for proc to be invoked in	the future
     whenever any X event occurs.  This	mechanism is not intended for
     dispatching X events on windows managed by	Tk (you	should use
     Tk_CreateEventHandler for this purpose).  Tk_CreateGenericHandler is
     intended for other	purposes, such as tracing X events, monitoring events
     on	windows	not owned by Tk, accessing X-related libraries that were not
     originally	designed for use with Tk, and so on.

     The callback to proc will be made by Tk_HandleEvent; this mechanism only
     works in programs that dispatch events through Tk_HandleEvent (or through
     other Tk procedures that call Tk_HandleEvent, such	as Tk_DoOneEvent or
     Tk_MainLoop).

     Proc should have arguments	and result that	match the type Tk_GenericProc:
	  typedef int Tk_GenericProc(
	       ClientData clientData,
	       XEvent *eventPtr);
     The clientData parameter to proc is a copy	of the clientData argument
     given to Tk_CreateGenericHandler when the callback	was created.
     Typically,	clientData points to a data structure containing applicationspecific
 information about	how to handle events.  EventPtr	is a pointer
     to	the X event.

     Whenever an X event is processed by Tk_HandleEvent, proc is called.  The
     return value from proc is normally	0.  A non-zero return value indicates
     that the event is not to be handled further; that is, proc	has done all
     processing	that is	to be allowed for the event.

     If	there are multiple generic event handlers, each	one is called for each
     event, in the order in which they were established.





									Page 1






Tk_CreateGenericHandler(3Tk)			  Tk_CreateGenericHandler(3Tk)



     Tk_DeleteGenericHandler may be called to delete a previously-created
     generic event handler:  it	deletes	each handler it	finds that matches the
     proc and clientData arguments.  If	no such	handler	exists,	then
     Tk_DeleteGenericHandler returns without doing anything.  Although Tk
     supports it, it's probably	a bad idea to have more	than one callback with
     the same proc and clientData arguments.

     Establishing a generic event handler does nothing to ensure that the
     process will actually receive the X events	that the handler wants to
     process.  For example, it is the caller's responsibility to invoke
     XSelectInput to select the	desired	events,	if that	is necessary.

KEYWORDS    [Toc]    [Back]

     bind, callback, event, handler


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
eventhndlr IRIX associate procedure callback with an X event
filehndlr IRIX associate procedure callbacks with files or devices
dowhenidle IRIX invoke a procedure when there are no pending events
csa_call_callbacks HP-UX force the invocation of the callback functions associated with the specified callback list(s)
fmmakefont IRIX associate a transformation matrix with a font
cmstaggif IRIX associate an ICC device profile with a GIF image
cmstagsgi IRIX associate an ICC device profile with an SGI image
glxassociatedmpbuffersgix IRIX associate a DMbuffer with a GLX pixel buffer
item_userptr FreeBSD associate application data with a menu item
set_item_userptr FreeBSD associate application data with a menu item
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service