Tk_GetAnchorFromObj, Tk_GetAnchor, Tk_NameOfAnchor − translate between strings and anchor positions


#include <tk.h>

interp, objPtr, anchorPtr)

interp, string, anchorPtr)

const char *


Tcl_Interp *interp (in)

Interpreter to use for error reporting, or NULL.

Tcl_Obj *objPtr (in/out)

String value contains name of anchor point: “n”, “ne”, “e”, “se”, “s”, “sw”, “w”, “nw”, or “center”; internal rep will be modified to cache corresponding Tk_Anchor.

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.

Tk_Anchor anchor (in)

Anchor position, e.g. TCL_ANCHOR_CENTER.



Tk_GetAnchorFromObj places in *anchorPtr an anchor position (enumerated type Tk_Anchor) corresponding to objPtr’s value. The result will be one of TK_ANCHOR_N, TK_ANCHOR_NE, TK_ANCHOR_E, TK_ANCHOR_SE, TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW, or TK_ANCHOR_CENTER. Anchor positions are typically used for indicating a point on an object that will be used to position the object, e.g. TK_ANCHOR_N means position the top center point of the object at a particular place.

Under normal circumstances the return value is TCL_OK and interp is unused. If string does not contain a valid anchor position or an abbreviation of one of these names, TCL_ERROR is returned, *anchorPtr is unmodified, and an error message is stored in interp’s result if interp is not NULL. Tk_GetAnchorFromObj caches information about the return value in objPtr, which speeds up future calls to Tk_GetAnchorFromObj with the same objPtr.

Tk_GetAnchor is identical to Tk_GetAnchorFromObj except that the description of the anchor is specified with a string instead of an object. This prevents Tk_GetAnchor from caching the return value, so Tk_GetAnchor is less efficient than Tk_GetAnchorFromObj.

Tk_NameOfAnchor is the logical inverse of Tk_GetAnchor. Given an anchor position such as TK_ANCHOR_N it returns a statically-allocated string corresponding to anchor. If anchor is not a legal anchor value, then “unknown anchor position” is returned.


anchor position

More Linux Commands

uxterm(1) - X terminal emulator for Unicode (UTF-8) environm
uxterm is a wrapper around the xterm(1) program that invokes the latter program with the UXTerm X resource class set. All arguments to uxterm are passed to xter

glEvalPoint2(3gl) - generate and evaluate a single point in
glMapGrid and glEvalMesh are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. glEvalPoint can be used to evaluat

IO::Lines(3pm) - IO:: interface for reading/writing an array
This class implements objects which behave just like FileHandle (or IO::Handle) objects, except that you may use them to write to (or read from) an array of lin

ber_bvarray_add(3) - OpenLDAP LBER types and allocation func
The following are the basic types and structures defined for use with the Lightweight BER library. ber_int_t is a signed integer of at least 32 bits. It is comm

perl5182delta(1) what is new for perl v5.18.2 (Man Page)....
This document describes differences between the 5.18.1 release and the 5.18.2 release. If you are upgrading from an earlier release such as 5.18.0, first read p

wbkgrnd(3ncurses) - curses window complex background manipul
The bkgrndset and wbkgrndset routines manipulate the background of the named window. The window background is a cchar_t consisting of any combination of attribu

perf_event_open(2) set up performance monitoring (Man Page)
Given a list of parameters, perf_event_open() returns a file descriptor, for use in subsequent system calls (read(2), mmap(2), prctl(2), fcntl(2), etc.). A call

checkproc(8) - Checks for a process by full path name.......
checkproc checks for running processes that use the specified executable. checkproc does not use the pid to verify a process but the full path of the correspond

fdopendir(3) - open a directory (Library - Linux man page)
The opendir() function opens a directory stream corresponding to the directory name, and returns a pointer to the directory stream. The stream is positioned at

glVertex4iv(3gl) - specify a vertex - Linux manual page.....
glVertex commands are used within glBegin/glEnd pairs to specify point, line, and polygon vertices. The current color, normal, and texture coordinates are assoc

Tcl_FSGetFileSystemForPath(3) - procedures to interact with
There are several reasons for calling the Tcl_FS API functions (e.g. Tcl_FSAccess and Tcl_FSStat) rather than calling system level functions like access and sta

sched_get_priority_max(2) - get static priority range.......
sched_get_priority_max() returns the maximum priority value that can be used with the scheduling algorithm identified by policy. sched_get_priority_min() return

We can't live, work or learn in freedom unless the software we use is free.