GetSelect.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" 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.
- '"
- '" RCS: @(#) $Id: GetSelect.3,v 1.2 1998/09/14 18:22:51 stanton Exp $
- '"
- .so man.macros
- .TH Tk_GetSelection 3 4.0 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_GetSelection - retrieve the contents of a selection
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- int
- fBTk_GetSelectionfR(fIinterp, tkwin, selection, target, proc, clientDatafR)
- .SH ARGUMENTS
- .AS Tk_GetSelProc clientData
- .AP Tcl_Interp *interp in
- Interpreter to use for reporting errors.
- .AP Tk_Window tkwin in
- Window on whose behalf to retrieve the selection (determines
- display from which to retrieve).
- .AP Atom selection in
- The name of the selection to be retrieved.
- .AP Atom target in
- Form in which to retrieve selection.
- .AP Tk_GetSelProc *proc in
- Procedure to invoke to process pieces of the selection as they
- are retrieved.
- .AP ClientData clientData in
- Arbitrary one-word value to pass to fIprocfR.
- .BE
- .SH DESCRIPTION
- .PP
- fBTk_GetSelectionfR retrieves the selection specified by the atom
- fIselectionfR in the format specified by fItargetfR. The
- selection may actually be retrieved in several pieces; as each piece
- is retrieved, fIprocfR is called to process the piece. fIProcfR
- should have arguments and result that match the type
- fBTk_GetSelProcfR:
- .CS
- typedef int Tk_GetSelProc(
- ClientData fIclientDatafR,
- Tcl_Interp *fIinterpfR,
- char *fIportionfR);
- .CE
- The fIclientDatafR and fIinterpfR parameters to fIprocfR
- will be copies of the corresponding arguments to
- fBTk_GetSelectionfR. fIPortionfR will be a pointer to
- a string containing part or all of the selection. For large
- selections, fIprocfR will be called several times with successive
- portions of the selection. The X Inter-Client Communication
- Conventions Manual allows a selection to be returned in formats
- other than strings, e.g. as an array of atoms or integers. If
- this happens, Tk converts the selection back into a string
- before calling fIprocfR. If a selection is returned as an
- array of atoms, Tk converts it to a string containing the atom names
- separated by white space. For any other format besides string,
- Tk converts a selection to a string containing hexadecimal
- values separated by white space.
- .PP
- fBTk_GetSelectionfR returns to its caller when the selection has
- been completely retrieved and processed by fIprocfR, or when a
- fatal error has occurred (e.g. the selection owner didn't respond
- promptly). fBTk_GetSelectionfR normally returns TCL_OK; if
- an error occurs, it returns TCL_ERROR and leaves an error message
- in fIinterp->resultfR. fIProcfR should also return either
- TCL_OK or TCL_ERROR. If fIprocfR encounters an error in dealing with the
- selection, it should leave an error message in fIinterp->resultfR
- and return TCL_ERROR; this will abort the selection retrieval.
- .SH KEYWORDS
- format, get, selection retrieval