Tk_CreateGenericHandler, Tk_DeleteGenericHandler − associate procedure callback with all X events


#include <tk.h>

Tk_CreateGenericHandler(proc, clientData)

Tk_DeleteGenericHandler(proc, clientData)


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.



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 application-specific 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.

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.


bind, callback, event, handler

More Linux Commands

ldap_dn2ufn(3) - LDAP DN handling routines - Linux man page
These routines allow LDAP entry names (Distinguished Names, or DNs) to be obtained, parsed, converted to a user-friendly form, and tested. A DN has the form des

git-checkout-index(1) - Copy files from the index to the wor
Will copy all files listed from the index to the working directory (not overwriting existing files). OPTIONS -u, --index update stat information for the checked

addch(3ncurses) - add a character (with attributes) to a cur
The addch, waddch, mvaddch and mvwaddch routines put the character ch into the given window at its current window position, which is then advanced. They are ana

XtCreateApplicationShell(3) - create top-level widget instan
The procedure XtCreateApplicationShell calls XtAppCreateShell with the application NULL, the application class passed to XtInitialize, and the default applicati

SQL::Dialects::Role(3pm) - The role of being a SQL::Dialect
This adds the role of being a SQL::Dialect to your class. Requirements You must implement... get_config my $config = $class-&gt;get_config; Returns information abo

pwunconv(8) - convert from shadow account - Linux man page
The pwconv command creates shadow from passwd and an optionally existing shadow. The pwunconv command creates passwd from passwd and shadow and then removes sha

FcConfigGetFonts(3) - Get config font set - Linux man page
Returns one of the two sets of fonts from the configuration as specified by set. This font set is owned by the library and must not be modified or freed. If con

sasl_encode(3) - Encode data for transport to authenticated
sasl_encode encodes data to be sent to be sent to a remote host who weve had a successful authentication session with. If there is a negotiated security the dat

Tcl_UniCharIsAlnum(3) - routines for classification of Tcl_U
All of the routines described examine Tcl_UniChars and return a boolean value. A non-zero return value means that the character does belong to the character cla

gnutls_pkcs11_privkey_import_url(3) - API function (ManPage)
This function will import a PKCS 11 URL identifying a private key to the gnutls_pkcs11_privkey_t structure. In reality since in most cases keys cannot be export

cosh(3) - hyperbolic cosine function - Linux manual page....
The cosh() function returns the hyperbolic cosine of x, which is defined mathematically as: cosh(x) = (exp(x) + exp(-x)) / 2 RETURN VALUE On success, these func

XkbSARedirectVModsMask(3) - Returns the vmods_mask0 and vmod
XkbSARedirectVModsMask.3 - Actions associated with the XkbRedirectKeyAction structure generate KeyPress and KeyRelease events containing a keycode different fro

We can't live, work or learn in freedom unless the software we use is free.