home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / Name.3 < prev    next >
Encoding:
Text File  |  1993-04-01  |  4.1 KB  |  99 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/Name.3,v 1.8 93/04/01 09:41:45 ouster Exp $ SPRITE (Berkeley)
  22. '\" 
  23. .so man.macros
  24. .HS Tk_Name tkc
  25. .BS
  26. .SH NAME
  27. Tk_Name, Tk_PathName, Tk_NameToWindow \- convert between names and window tokens
  28. .SH SYNOPSIS
  29. .nf
  30. \fB#include <tk.h>\fR
  31. .sp
  32. Tk_Uid
  33. \fBTk_Name\fR(\fItkwin\fR)
  34. .sp
  35. char *
  36. \fBTk_PathName\fR(\fItkwin\fR)
  37. .sp
  38. Tk_Window
  39. \fBTk_NameToWindow\fR(\fIinterp, pathName, tkwin\fR)
  40. .SH ARGUMENTS
  41. .AS Tcl_Interp *pathName
  42. .AP Tk_Window tkwin in
  43. Token for window.
  44. .AP Tcl_Interp *interp out
  45. Interpreter to use for error reporting.
  46. .AP char *pathName in
  47. Character string containing path name of window.
  48. .BE
  49.  
  50. .SH DESCRIPTION
  51. .PP
  52. Each window managed by Tk has two names, a short name that identifies
  53. a window among children of the same parent, and a path name that
  54. identifies the window uniquely among all the windows belonging to the
  55. same main window.  The path name is used more often in Tk than the
  56. short name;  many commands, like \fBbind\fR, expect path names as
  57. arguments.
  58. .PP
  59. The \fBTk_Name\fR macro returns a window's
  60. short name, which is the same as the \fIname\fR argument
  61. passed to \fBTk_CreateMainWindow\fR
  62. or \fBTk_CreateTopLevelWindow\fR or \fBTk_CreateChildWindow\fR when
  63. the window was created.  The value is returned
  64. as a Tk_Uid, which may be used just like a string pointer but also has
  65. the properties of a unique identfier (see the manual entry for
  66. \fBTk_GetUid\fR for details).
  67. .PP
  68. The \fBTk_PathName\fR macro returns a
  69. hierarchical name for \fItkwin\fR.
  70. Path names have a structure similar to file names in Unix but with
  71. dots between elements instead of slashes:  the main window for
  72. an application (one created by calling \fBTk_CreateMainWindow\fR
  73. or by calling \fBTk_CreateTopLevelWindow\fR with a NULL \fIparent\fR
  74. argument) has the path name ``.'';  its children have names like
  75. ``.a'' and ``.b''; their children have names like ``.a.aa'' and
  76. ``.b.bb''; and so on.  A window is considered to be be a child of
  77. another window for naming purposes if the second window was named
  78. as the first window's \fIparent\fR when the first window was created.
  79. This is not always the same as the X window hierarchy.  For
  80. example, a pop-up
  81. is created as a child of the root window, but its logical parent will
  82. usually be a window within the application.
  83. .PP
  84. The procedure \fBTk_NameToWindow\fR returns the token for a window
  85. given its path name (the \fIpathName\fR argument) and another window
  86. belonging to the same main window (\fItkwin\fR).  It normally
  87. returns a token for the named window, but if no such window exists
  88. \fBTk_NameToWindow\fR leaves an error message in \fIinterp->result\fR
  89. and returns NULL.  The \fItkwin\fR argument to \fBTk_NameToWindow\fR
  90. is needed because path names are only unique within a single
  91. application hierarchy.  If, for example, a single process has opened
  92. two main windows, each will have a separate naming hierarchy and the
  93. same path name might appear in each of the hierarchies.  Normally
  94. \fItkwin\fR is the main window of the desired hierarchy, but this
  95. need not be the case:  any window in the desired hierarchy may be used.
  96.  
  97. .SH KEYWORDS
  98. name, path name, token, window
  99.