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

glGetPixelMapuiv(3gl) - return the specified pixel map......
See the glPixelMap reference page for a description of the acceptable values for the map parameter. glGetPixelMap returns in values the contents of the pixel ma

gnutls_mac_get(3) - API function (Library - Linux man page)
Get currently used MAC algorithm. RETURNS the currently used mac algorithm, a gnutls_mac_algorithm_t value. REPORTING BUGS Report bugs to &lt;;.

glVertex4f(3gl) - specify a vertex - Linux manual page......
glVertex commands are used within glBegin/glEnd pairs to specify point, line, and polygon vertices. The current color, normal, and texture coordinates are assoc

XML::DOM::Document(3pm) - An XML document node in XML::DOM
XML::DOM::Document extends XML::DOM::Node. It is the main root of the XML document structure as returned by XML::DOM::Parser::parse and XML::DOM::Parser::parsef

eqn(1) - format equations for troff or MathML (Man Page)....
This manual page describes the GNU version of eqn, which is part of the groff document formatting system. eqn compiles descriptions of equations embedded within

gnutls_x509_crt_set_key(3) - API function - Linux man page
This function will set the public parameters from the given private key to the certificate. Only RSA keys are currently supported. RETURNS On success, GNUTLS_E_

tzselect(8) - select a timezone (Admin - Linux man page)....
The tzselect program asks the user for information about the current location, and outputs the resulting timezone description to standard output. The output is

new_form_sp(3ncurses) - curses screen-pointer extension.....
This implementation can be configured to provide a set of functions which improve the ability to manage multiple screens. This feature can be added to any of th

libxrx(1) - RX Web Browser Plug-in - Linux manual page......
The RX Plug-in may be used with web browsers in the Mozilla family, including Netscape Navigator (3.0 or later), Firefox, and SeaMonkey, to interpret documents

overload(3pm) - Package for overloading Perl operations.....
This pragma allows overloading of Perls operators for a class. To overload built-in functions, see Overriding Built-in Functions in perlsub instead. Fundamental

Ttk_MakeBox(3) - Tk themed geometry utilities (Man Page)....
The Ttk_Box structure represents a rectangular region of a window: typedef struct { int x; int y; int width; int height; } Ttk_Box; All coordinates are relative

ptar(1) - (unknown subject) (Commands - Linux man page).....
ptar is a small, tar look-alike program that uses the perl module Archive::Tar to extract, create and list tar archives. SYNOPSIS ptar -c [-v] [-z] [-C] [-f ARC

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