⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eventhndlr.3

📁 linux系统下的音频通信
💻 3
字号:
'\"'\" Copyright (c) 1990 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) EventHndlr.3 1.15 96/03/14 10:55:08'\" .so man.macros.TH Tk_CreateEventHandler 3 "" Tk "Tk Library Procedures".BS.SH NAMETk_CreateEventHandler, Tk_DeleteEventHandler \- associate procedure callback with an X event.SH SYNOPSIS.nf\fB#include <tk.h>\fR.sp\fBTk_CreateEventHandler\fR(\fItkwin, mask, proc, clientData\fR).sp\fBTk_DeleteEventHandler\fR(\fItkwin, mask, proc, clientData\fR).SH ARGUMENTS.AS "unsigned long" clientData.AP Tk_Window tkwin inToken for window in which events may occur..AP "unsigned long" mask inBit-mask of events (such as \fBButtonPressMask\fR)for which \fIproc\fR should be called..AP Tk_EventProc *proc inProcedure to invoke whenever an event in \fImask\fR occursin the window given by \fItkwin\fR..AP ClientData clientData inArbitrary one-word value to pass to \fIproc\fR..BE.SH DESCRIPTION.PP\fBTk_CreateEventHandler\fR arranges for \fIproc\fR to beinvoked in the future whenever one of the event types specifiedby \fImask\fR occurs in the window specified by \fItkwin\fR.The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;this mechanism only works in programs that dispatch eventsthrough \fBTk_HandleEvent\fR (or through other Tk procedures thatcall \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or\fBTk_MainLoop\fR)..PP\fIProc\fR should have arguments and result that match thetype \fBTk_EventProc\fR:.CStypedef void Tk_EventProc(	ClientData \fIclientData\fR,	XEvent *\fIeventPtr\fR);.CEThe \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fRargument given to \fBTk_CreateEventHandler\fR when the callbackwas created.  Typically, \fIclientData\fR points to a datastructure containing application-specific information aboutthe window in which the event occurred.  \fIEventPtr\fR isa pointer to the X event, which will be one of the onesspecified in the \fImask\fR argument to \fBTk_CreateEventHandler\fR..PP\fBTk_DeleteEventHandler\fR may be called to delete apreviously-created event handler:  it deletes the first handlerit finds that is associated with \fItkwin\fR and matches the\fImask\fR, \fIproc\fR, and \fIclientData\fR arguments.  Ifno such handler exists, then \fBTk_EventHandler\fR returnswithout doing anything.  Although Tk supports it, it's probablya bad idea to have more than one callback with the same \fImask\fR,\fIproc\fR, and \fIclientData\fR arguments.When a window is deleted all of its handlers will be deletedautomatically;  in this case there is no need to call\fBTk_DeleteEventHandler\fR..PPIf multiple handlers are declared for the same type of X eventon the same window, then the handlers will be invoked in theorder they were created..SH KEYWORDSbind, callback, event, handler

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -