Seth Woolley's Man Viewer

Name(3) - Tk_Name, Tk_NameToWindow, Tk_PathName, Tk_Name, Tk_NameToWindow, Tk_PathName - convert between names and window tokens - man 3 Name

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

Tk_Name(3)                   Tk Library Procedures                  Tk_Name(3)

       Tk_Name,  Tk_PathName, Tk_NameToWindow - convert between names and win-
       dow tokens

       #include <tk.h>


       char *

       Tk_NameToWindow(interp, pathName, tkwin)

       Token for window.  Interpreter to use for error(8,n)  reporting.   Character
       string(3,n) containing path name of window.

       Each window managed by Tk has two names, a short name that identifies a
       window among children of the same parent, and a path name that  identi-
       fies  the  window  uniquely among all the windows belonging to the same
       main window.  The path name is used more often in(1,8)  Tk  than  the  short
       name;  many commands, like bind(2,n,1 builtins), expect path names as arguments.

       The  Tk_Name  macro returns a window's short name, which is the same as
       the name argument passed to Tk_CreateWindow when the  window  was  cre-
       ated.  The value is returned as a Tk_Uid, which may be used just like a
       string(3,n) pointer but also has the properties of a unique identifier  (see
       the manual entry for Tk_GetUid for details).

       The  Tk_PathName  macro  returns  a  hierarchical name for tkwin.  Path
       names have a structure similar to file(1,n) names  in(1,8)  Unix  but  with  dots
       between  elements  instead of slashes:  the main window for an applica-
       tion has the path name ``.'';  its children have names like ``.a''  and
       ``.b'';  their children have names like ``.a.aa'' and ``''; and so
       on.  A window is considered to be be a child of another window for nam-
       ing  purposes if(3,n) the second window was named(5,8) as the first window's par-
       ent when the first window was created.  This is not always the same  as
       the X window hierarchy.  For example, a pop-up is created as a child of
       the root window, but its logical parent will usually be a window within
       the application.

       The  procedure Tk_NameToWindow returns the token for a window given its
       path name (the pathName argument) and another window belonging  to  the
       same  main  window  (tkwin).  It normally returns a token for the named(5,8)
       window, but if(3,n) no such window exists Tk_NameToWindow  leaves  an  error(8,n)
       message  in(1,8)  interp->result  and  returns  NULL.  The tkwin argument to
       Tk_NameToWindow is needed because path names are only unique  within  a
       single  application  hierarchy.   If, for example, a single process has
       opened two main windows, each will have a separate naming hierarchy and
       the  same  path name might appear in(1,8) each of the hierarchies.  Normally
       tkwin is the main window of the desired hierarchy, but this need not be
       the case:  any window in(1,8) the desired hierarchy may be used.

       name, path name, token, window

Tk                                                                  Tk_Name(3)

References for this manual (incoming links)