CrtCmHdlr.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 2000 Ajuba Solutions.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: CrtCmHdlr.3,v 1.1 2000/06/03 08:57:34 hobbs Exp $
- '"
- .so man.macros
- .TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler - associate procedure callback with ClientMessage type X events
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- fBTk_CreateClientMessageHandlerfR(fIprocfR)
- .sp
- fBTk_DeleteClientMessageHandlerfR(fIprocfR)
- .SH ARGUMENTS
- .AP Tk_ClientMessageProc *proc in
- Procedure to invoke whenever a ClientMessage X event occurs on any display.
- .BE
- .SH DESCRIPTION
- .PP
- fBTk_CreateClientMessageHandlerfR arranges for fIprocfR to be invoked
- in the future whenever a ClientMessage X event occurs that isn't handled by
- fBWM_PROTOCOLfR. fBTk_CreateClientMessageHandlerfR is intended for use
- by applications which need to watch X ClientMessage events, such as drag and
- drop applications.
- .PP
- The callback to fIprocfR will be made by fBTk_HandleEventfR;
- this mechanism only works in programs that dispatch events
- through fBTk_HandleEventfR (or through other Tk procedures that
- call fBTk_HandleEventfR, such as fBTk_DoOneEventfR or
- fBTk_MainLoopfR).
- .PP
- fIProcfR should have arguments and result that match the
- type fBTk_ClientMessageProcfR:
- .CS
- typedef int Tk_ClientMessageProc(
- Tk_Window fItkwinfR,
- XEvent *fIeventPtrfR);
- .CE
- The fItkwinfR parameter to fIprocfR is the Tk window which is
- associated with this event. fIEventPtrfR is a pointer to the X event.
- .PP
- Whenever an X ClientMessage event is processed by fBTk_HandleEventfR,
- the fIprocfR is called if it wasn't handled as a fBWM_PROTOCOLfR.
- The return value from fIprocfR is normally 0.
- A non-zero return value indicates that the event is not to be handled
- further; that is, fIprocfR has done all processing that is to be
- allowed for the event.
- .PP
- If there are multiple ClientMessage event handlers, each one is called
- for each event, in the order in which they were established.
- .PP
- fBTk_DeleteClientMessageHandlerfR may be called to delete a
- previously-created ClientMessage event handler: it deletes each handler it
- finds that matches the fIprocfR argument. If no such handler exists,
- then fBTk_DeleteClientMessageHandlerfR returns without doing anything.
- Although Tk supports it, it's probably a bad idea to have more than one
- callback with the same fIprocfR argument.
- .SH KEYWORDS
- bind, callback, event, handler