NAME
TkGetAnchorFromObj, TkGetAnchor, TkNameOfAnchor - translate between
strings and anchor positionsSYNOPSIS
##iinncclluuddee <
int | TTkkGGeettAAnncchhoorrFFrroommOObbjj((interp, objPtr, anchorPtr)) | int TTkkGGeettAAnncchhoorr((interp, string, anchorPtr)) CONST char * TTkkNNaammeeOOffAAnncchhoorr((anchor)) AARRGGUUMMEENNTTSS> TclInterp *interp (in) Interpreter to use for error report-
ing, or NULL. TclObj *objPtr (in/out) || String value contains name of anchor | point: nn, nnee, ee, ssee, ss, ssww, ww, nnww, |or cceenntteerr; internal rep will be mod- |
ified to cache corresponding | TkAnchor. | CONST | char *string (in) | | Same as objPtr except description of | anchor point is passed as a string. int *anchorPtr (out) Pointer to location in which to store anchor position corresponding to objPtr or string. TkAnchor anchor (in) Anchor position, e.g. TTCCLLAANNCCHHOORRCCEENNTTEERR.DESCRIPTION
TTkkGGeettAAnncchhoorrFFrroommOObbjj places in *anchorPtr an anchor position (enumerated | type TTkkAAnncchhoorr) corresponding to objPtr's value. The result will be | one of TTKKAANNCCHHOORRNN, TTKKAANNCCHHOORRNNEE, TTKKAANNCCHHOORREE, TTKKAANNCCHHOORRSSEE, |TTKKAANNCCHHOORRSS, TTKKAANNCCHHOORRSSWW, TTKKAANNCCHHOORRWW, TTKKAANNCCHHOORRNNWW, or TTKKAANNCCHHOORRCCEENN- |
TTEERR. Anchor positions are typically used for indicating a point on an | object that will be used to position the object, e.g. TTKKAANNCCHHOORRNN means | position the top center point of the object at a particular place. | Under normal circumstances the return value is TTCCLLOOKK and interp is |unused. If string doesn't contain a valid anchor position or an abbre- |
viation of one of these names, TTCCLLEERRRROORR is returned, *anchorPtr is | unmodified, and an error message is stored in interp's result if interp | isn't NULL. TTkkGGeettAAnncchhoorrFFrroommOObbjj caches information about the return | value in objPtr, which speeds up future calls to TTkkGGeettAAnncchhoorrFFrroommOObbjj | with the same objPtr. | TTkkGGeettAAnncchhoorr is identical to TTkkGGeettAAnncchhoorrFFrroommOObbjj except that the | description of the anchor is specified with a string instead of an | object. This prevents TTkkGGeettAAnncchhoorr from caching the return value, so | TTkkGGeettAAnncchhoorr is less efficient than TTkkGGeettAAnncchhoorrFFrroommOObbjj. TTkkNNaammeeOOffAAnncchhoorr is the logical inverse of TTkkGGeettAAnncchhoorr. Given ananchor position such as TTKKAANNCCHHOORRNN it returns a statically-allocated
string corresponding to anchor. If anchor isn't a legal anchor value, then ``unknown anchor position'' is returned. KKEEYYWWOORRDDSS anchor position Tk 8.1 TkGetAnchorFromObj(3)