📄 getselect.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: @(#) GetSelect.3 1.16 96/08/27 13:21:28'\" .so man.macros.TH Tk_GetSelection 3 4.0 Tk "Tk Library Procedures".BS.SH NAMETk_GetSelection \- retrieve the contents of a selection.SH SYNOPSIS.nf\fB#include <tk.h>\fR.spint\fBTk_GetSelection\fR(\fIinterp, tkwin, selection, target, proc, clientData\fR).SH ARGUMENTS.AS Tk_GetSelProc clientData.AP Tcl_Interp *interp inInterpreter to use for reporting errors..AP Tk_Window tkwin inWindow on whose behalf to retrieve the selection (determinesdisplay from which to retrieve)..AP Atom selection inThe name of the selection to be retrieved..AP Atom target inForm in which to retrieve selection..AP Tk_GetSelProc *proc inProcedure to invoke to process pieces of the selection as theyare retrieved..AP ClientData clientData inArbitrary one-word value to pass to \fIproc\fR..BE.SH DESCRIPTION.PP\fBTk_GetSelection\fR retrieves the selection specified by the atom\fIselection\fR in the format specified by \fItarget\fR. Theselection may actually be retrieved in several pieces; as each pieceis retrieved, \fIproc\fR is called to process the piece. \fIProc\fRshould have arguments and result that match the type\fBTk_GetSelProc\fR:.CStypedef int Tk_GetSelProc( ClientData \fIclientData\fR, Tcl_Interp *\fIinterp\fR, char *\fIportion\fR);.CEThe \fIclientData\fR and \fIinterp\fR parameters to \fIproc\fR will be copies of the corresponding arguments to\fBTk_GetSelection\fR. \fIPortion\fR will be a pointer toa string containing part or all of the selection. For largeselections, \fIproc\fR will be called several times with successiveportions of the selection. The X Inter-Client CommunicationConventions Manual allows a selection to be returned in formatsother than strings, e.g. as an array of atoms or integers. Ifthis happens, Tk converts the selection back into a stringbefore calling \fIproc\fR. If a selection is returned as anarray of atoms, Tk converts it to a string containing the atom namesseparated by white space. For any other format besides string,Tk converts a selection to a string containing hexadecimalvalues separated by white space..PP\fBTk_GetSelection\fR returns to its caller when the selection hasbeen completely retrieved and processed by \fIproc\fR, or when afatal error has occurred (e.g. the selection owner didn't respondpromptly). \fBTk_GetSelection\fR normally returns TCL_OK; ifan error occurs, it returns TCL_ERROR and leaves an error messagein \fIinterp->result\fR. \fIProc\fR should also return eitherTCL_OK or TCL_ERROR. If \fIproc\fR encounters an error in dealing with theselection, it should leave an error message in \fIinterp->result\fRand return TCL_ERROR; this will abort the selection retrieval..SH KEYWORDSformat, get, selection retrieval
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -