GetAnchor.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: GetAnchor.3,v 1.4 2002/08/05 04:30:38 dgp Exp $
- '"
- .so man.macros
- .TH Tk_GetAnchorFromObj 3 8.1 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor - translate between strings and anchor positions
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- .VS 8.1
- int
- fBTk_GetAnchorFromObj(fIinterp, objPtr, anchorPtrfB)fR
- .VE
- .sp
- int
- fBTk_GetAnchor(fIinterp, string, anchorPtrfB)fR
- .sp
- CONST char *
- fBTk_NameOfAnchor(fIanchorfB)fR
- .SH ARGUMENTS
- .AS "Tk_Anchor" *anchorPtr
- .AP Tcl_Interp *interp in
- Interpreter to use for error reporting, or NULL.
- .VS 8.1 br
- .AP Tcl_Obj *objPtr in/out
- String value contains name of anchor point: fBnfR, fBnefR,
- fBefR, fBsefR, fBsfR, fBswfR, fBwfR, fBnwfR, or fBcenterfR;
- internal rep will be modified to cache corresponding Tk_Anchor.
- .AP "CONST char" *string in
- Same as fIobjPtrfR except description of anchor point is passed as
- a string.
- .VE
- .AP int *anchorPtr out
- Pointer to location in which to store anchor position corresponding to
- fIobjPtrfR or fIstringfR.
- .AP Tk_Anchor anchor in
- Anchor position, e.g. fBTCL_ANCHOR_CENTERfR.
- .BE
- .SH DESCRIPTION
- .PP
- .VS 8.1
- fBTk_GetAnchorFromObjfR places in fI*anchorPtrfR an anchor position
- (enumerated type fBTk_AnchorfR)
- corresponding to fIobjPtrfR's value. The result will be one of
- fBTK_ANCHOR_NfR, fBTK_ANCHOR_NEfR, fBTK_ANCHOR_EfR, fBTK_ANCHOR_SEfR,
- fBTK_ANCHOR_SfR, fBTK_ANCHOR_SWfR, fBTK_ANCHOR_WfR, fBTK_ANCHOR_NWfR,
- or fBTK_ANCHOR_CENTERfR.
- Anchor positions are typically used for indicating a point on an object
- that will be used to position the object, e.g. fBTK_ANCHOR_NfR means
- position the top center point of the object at a particular place.
- .PP
- Under normal circumstances the return value is fBTCL_OKfR and
- fIinterpfR is unused.
- If fIstringfR doesn't contain a valid anchor position
- or an abbreviation of one of these names, fBTCL_ERRORfR is returned,
- fI*anchorPtrfR is unmodified, and an error message is
- stored in fIinterpfR's result if fIinterpfR isn't NULL.
- fBTk_GetAnchorFromObjfR caches information about the return
- value in fIobjPtrfR, which speeds up future calls to
- fBTk_GetAnchorFromObjfR with the same fIobjPtrfR.
- .PP
- fBTk_GetAnchorfR is identical to fBTk_GetAnchorFromObjfR except
- that the description of the anchor is specified with a string instead
- of an object. This prevents fBTk_GetAnchorfR from caching the
- return value, so fBTk_GetAnchorfR is less efficient than
- fBTk_GetAnchorFromObjfR.
- .VE
- .PP
- fBTk_NameOfAnchorfR is the logical inverse of fBTk_GetAnchorfR.
- Given an anchor position such as fBTK_ANCHOR_NfR it returns a
- statically-allocated string corresponding to fIanchorfR.
- If fIanchorfR isn't a legal anchor value, then
- ``unknown anchor position'' is returned.
- .SH KEYWORDS
- anchor position