1Tk_Name(3)                   Tk Library Procedures                  Tk_Name(3)
2
3
4
5______________________________________________________________________________
6

NAME

8       Tk_Name,  Tk_PathName, Tk_NameToWindow - convert between names and win‐
9       dow tokens
10

SYNOPSIS

12       #include <tk.h>
13
14       Tk_Uid
15       Tk_Name(tkwin)
16
17       char *
18       Tk_PathName(tkwin)
19
20       Tk_Window
21       Tk_NameToWindow(interp, pathName, tkwin)
22

ARGUMENTS

24       Tk_Window tkwin (in)               Token for window.
25
26       Tcl_Interp *interp (out)           Interpreter to use for error report‐
27                                          ing.
28
29       const char *pathName (in)          Character   string  containing  path
30                                          name of window.
31______________________________________________________________________________
32

DESCRIPTION

34       Each window managed by Tk has two names, a short name that identifies a
35       window  among children of the same parent, and a path name that identi‐
36       fies the window uniquely among all the windows belonging  to  the  same
37       main  window.   The  path  name is used more often in Tk than the short
38       name;  many commands, like bind, expect path names as arguments.
39
40       The Tk_Name macro returns a window's short name, which is the  same  as
41       the  name  argument  passed to Tk_CreateWindow when the window was cre‐
42       ated.  The value is returned as a Tk_Uid, which may be used just like a
43       string  pointer but also has the properties of a unique identifier (see
44       the manual entry for Tk_GetUid for details).
45
46       The Tk_PathName macro returns a  hierarchical  name  for  tkwin.   Path
47       names  have a structure similar to file names in Unix but with dots be‐
48       tween elements instead of slashes:  the main window for an  application
49       has  the  path  name  “.”;  its children have names like “.a” and “.b”;
50       their children have names like “.a.aa” and “.b.bb”; and so on.  A  win‐
51       dow  is  considered to be a child of another window for naming purposes
52       if the second window was named as the first window's  parent  when  the
53       first  window was created.  This is not always the same as the X window
54       hierarchy.  For example, a pop-up is created as a  child  of  the  root
55       window,  but its logical parent will usually be a window within the ap‐
56       plication.
57
58       The procedure Tk_NameToWindow returns the token for a window given  its
59       path  name  (the pathName argument) and another window belonging to the
60       same main window (tkwin).  It normally returns a token  for  the  named
61       window,  but  if  no such window exists Tk_NameToWindow leaves an error
62       message in interpreter interp's result and returns NULL.  The tkwin ar‐
63       gument  to Tk_NameToWindow is needed because path names are only unique
64       within a single application  hierarchy.   If,  for  example,  a  single
65       process  has  opened two main windows, each will have a separate naming
66       hierarchy and the same path name might appear in each  of  the  hierar‐
67       chies.  Normally tkwin is the main window of the desired hierarchy, but
68       this need not be the case:  any window in the desired hierarchy may  be
69       used.
70

KEYWORDS

72       name, path name, token, window
73
74
75
76Tk                                                                  Tk_Name(3)
Impressum