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

📄 crtselhdlr.3

📁 linux系统下的音频通信
💻 3
字号:
'\"'\" Copyright (c) 1990-1994 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: @(#) CrtSelHdlr.3 1.18 96/08/27 13:21:21'\" .so man.macros.TH Tk_CreateSelHandler 3 4.0 Tk "Tk Library Procedures".BS.SH NAMETk_CreateSelHandler, Tk_DeleteSelHandler \- arrange to handle requests for a selection.SH SYNOPSIS.nf\fB#include <tk.h>\fR.sp\fBTk_CreateSelHandler\fR(\fItkwin, selection, target, proc, clientData, format\fR).sp\fBTk_DeleteSelHandler\fR(\fItkwin, selection, target\fR).SH ARGUMENTS.AS Tk_SelectionProc clientData.AP Tk_Window tkwin inWindow for which \fIproc\fR will provide selection information..AP Atom selection inThe name of the selection for which \fIproc\fR will provideselection information..AP Atom target inForm in which \fIproc\fR can provide the selection (e.g. STRINGor FILE_NAME).  Corresponds to \fItype\fR arguments in \fBselection\fRcommands..AP Tk_SelectionProc *proc inProcedure to invoke whenever the selection is owned by \fItkwin\fRand the selection contents are requested in the format given by\fItarget\fR..AP ClientData clientData inArbitrary one-word value to pass to \fIproc\fR..AP Atom format inIf the selection requestor isn't in this process, \fIformat\fR determinesthe representation used to transmit the selection to itsrequestor..BE.SH DESCRIPTION.PP\fBTk_CreateSelHandler\fR arranges for a particular procedure(\fIproc\fR) to be called whenever \fIselection\fR is owned by\fItkwin\fR and the selection contents are requested in theform given by \fItarget\fR. \fITarget\fR should be one ofthe entries defined in the left column of Table 2 of theX Inter-Client Communication Conventions Manual (ICCCM) orany other form in which an application is willing to presentthe selection.  The most common form is STRING..PP\fIProc\fR should have arguments and result that match thetype \fBTk_SelectionProc\fR:.CStypedef int Tk_SelectionProc(	ClientData \fIclientData\fR,	int \fIoffset\fR,	char *\fIbuffer\fR,	int \fImaxBytes\fR);.CEThe \fIclientData\fR parameter to \fIproc\fR is a copy of the\fIclientData\fR argument given to \fBTk_CreateSelHandler\fR.Typically, \fIclientData\fR points to a datastructure containing application-specific information that isneeded to retrieve the selection.  \fIOffset\fR specifies anoffset position into the selection, \fIbuffer\fR specifies alocation at which to copy information about the selection, and\fImaxBytes\fR specifies the amount of space available at\fIbuffer\fR.  \fIProc\fR should place a NULL-terminated stringat \fIbuffer\fR containing \fImaxBytes\fR or fewer characters(not including the terminating NULL), and it should return acount of the number of non-NULL characters stored at\fIbuffer\fR.  If the selection no longer exists (e.g. it onceexisted but the user deleted the range of characters containingit), then \fIproc\fR should return -1..PPWhen transferring large selections, Tk will break them up intosmaller pieces (typically a few thousand bytes each) for moreefficient transmission.  It will do this by calling \fIproc\fRone or more times, using successively higher values of \fIoffset\fRto retrieve successive portions of the selection.  If \fIproc\fRreturns a count less than \fImaxBytes\fR it means that the entireremainder of the selection has been returned.  If \fIproc\fR's returnvalue is \fImaxBytes\fR it means there may be additional informationin the selection, so Tk must make another call to \fIproc\fR toretrieve the next portion..PP\fIProc\fR always returns selection information in the form of acharacter string.  However, the ICCCM allows for information tobe transmitted from the selection owner to the selection requestorin any of several formats, such as a string, an array of atoms, anarray of integers, etc.  The \fIformat\fR argument to\fBTk_CreateSelHandler\fR indicates what format should be used totransmit the selection to its requestor (see the middle column ofTable 2 of the ICCCM for examples).  If \fIformat\fR is notSTRING, then Tk will take the value returned by \fIproc\fR and dividedit into fields separated by white space.  If \fIformat\fR is ATOM,then Tk will return the selection as an array of atoms, with eachfield in \fIproc\fR's result treated as the name of one atom.  Forany other value of \fIformat\fR, Tk will return the selection as anarray of 32-bit values where each field of \fIproc\fR's result istreated as a number and translated to a 32-bit value.  In any event,the \fIformat\fR atom is returned to the selection requestor alongwith the contents of the selection..PPIf \fBTk_CreateSelHandler\fR is called when there already exists ahandler for \fIselection\fR and \fItarget\fR on \fItkwin\fR, then theexisting handler is replaced with a new one..PP\fBTk_DeleteSelHandler\fR removes the handler given by \fItkwin\fR,\fIselection\fR, and \fItarget\fR, if such a handler exists.If there is no such handler then it has no effect..SH KEYWORDSformat, handler, selection, target

⌨️ 快捷键说明

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