GetRelief.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 1990 The Regents of the University of California.
- '" Copyright (c) 1994-1998 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: GetRelief.3,v 1.4 2002/08/05 04:30:38 dgp Exp $
- '"
- .so man.macros
- .TH Tk_GetReliefFromObj 3 8.1 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_GetReliefFromObj, Tk_GetRelief, Tk_NameOfRelief - translate between strings and relief values
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- .VS 8.1
- int
- fBTk_GetReliefFromObj(fIinterp, objPtr, reliefPtrfB)fR
- .VE
- .sp
- int
- fBTk_GetRelief(fIinterp, name, reliefPtrfB)fR
- .sp
- CONST char *
- fBTk_NameOfRelief(fIrelieffB)fR
- .SH ARGUMENTS
- .AS "Tcl_Interp" *reliefPtr
- .AP Tcl_Interp *interp in
- Interpreter to use for error reporting.
- .VS 8.1 br
- .AP Tcl_Obj *objPtr in/out
- String value contains name of relief (one of fBflatfR, fBgroovefR,
- fBraisedfR, fBridgefR, fBsolidfR, or fBsunkenfR);
- internal rep will be modified to cache corresponding relief value.
- .AP char *string in
- Same as fIobjPtrfR except description of relief is passed as
- a string.
- .VE
- .AP int *reliefPtr out
- Pointer to location in which to store relief value corresponding to
- fIobjPtrfR or fInamefR.
- .AP "CONST char" *name
- Name of the relief.
- .AP int relief in
- Relief value (one of TK_RELIEF_FLAT, TK_RELIEF_RAISED, TK_RELIEF_SUNKEN,
- TK_RELIEF_GROOVE, TK_RELIEF_SOLID, or TK_RELIEF_RIDGE).
- .BE
- .SH DESCRIPTION
- .PP
- .VS 8.1
- fBTk_GetReliefFromObjfR places in fI*reliefPtrfR the relief value
- corresponding to the value of fIobjPtrfR. This value will be one of
- TK_RELIEF_FLAT, TK_RELIEF_RAISED, TK_RELIEF_SUNKEN,
- TK_RELIEF_GROOVE, TK_RELIEF_SOLID, or TK_RELIEF_RIDGE.
- Under normal circumstances the return value is TCL_OK and
- fIinterpfR is unused.
- If fIobjPtrfR doesn't contain one of the valid relief names
- or an abbreviation of one of them, then TCL_ERROR is returned,
- fI*reliefPtrfR is unmodified, and an error message
- is stored in fIinterpfR's result if fIinterpfR isn't NULL.
- fBTk_GetReliefFromObjfR caches information about the return
- value in fIobjPtrfR, which speeds up future calls to
- fBTk_GetReliefFromObjfR with the same fIobjPtrfR.
- .PP
- fBTk_GetRelieffR is identical to fBTk_GetReliefFromObjfR except
- that the description of the relief is specified with a string instead
- of an object. This prevents fBTk_GetRelieffR from caching the
- return value, so fBTk_GetRelieffR is less efficient than
- fBTk_GetReliefFromObjfR.
- .VE
- .PP
- fBTk_NameOfRelieffR is the logical inverse of fBTk_GetRelieffR.
- Given a relief value it returns the corresponding string (fBflatfR,
- fBraisedfR, fBsunkenfR, fBgroovefR, fBsolidfR, or fBridgefR).
- If fIrelieffR isn't a legal relief value, then ``unknown relief''
- is returned.
- .SH KEYWORDS
- name, relief, string