📄 name.3
字号:
'\"'\" Copyright (c) 1990 The Regents of the University of California.'\" Copyright (c) 1994-1997 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) Name.3 1.14 97/01/29 08:50:09'\" .so man.macros.TH Tk_Name 3 "" Tk "Tk Library Procedures".BS.SH NAMETk_Name, Tk_PathName, Tk_NameToWindow \- convert between names and window tokens.SH SYNOPSIS.nf\fB#include <tk.h>\fR.spTk_Uid\fBTk_Name\fR(\fItkwin\fR).spchar *\fBTk_PathName\fR(\fItkwin\fR).spTk_Window\fBTk_NameToWindow\fR(\fIinterp, pathName, tkwin\fR).SH ARGUMENTS.AS Tcl_Interp *pathName.AP Tk_Window tkwin inToken for window..AP Tcl_Interp *interp outInterpreter to use for error reporting..AP char *pathName inCharacter string containing path name of window..BE.SH DESCRIPTION.PPEach window managed by Tk has two names, a short name that identifiesa window among children of the same parent, and a path name thatidentifies the window uniquely among all the windows belonging to thesame main window. The path name is used more often in Tk than theshort name; many commands, like \fBbind\fR, expect path names asarguments..PPThe \fBTk_Name\fR macro returns a window'sshort name, which is the same as the \fIname\fR argumentpassed to \fBTk_CreateWindow\fR whenthe window was created. The value is returnedas a Tk_Uid, which may be used just like a string pointer but also hasthe properties of a unique identifier (see the manual entry for\fBTk_GetUid\fR for details)..PPThe \fBTk_PathName\fR macro returns ahierarchical name for \fItkwin\fR.Path names have a structure similar to file names in Unix but withdots between elements instead of slashes: the main window foran application has the path name ``.''; its children have names like``.a'' and ``.b''; their children have names like ``.a.aa'' and``.b.bb''; and so on. A window is considered to be be a child ofanother window for naming purposes if the second window was namedas the first window's \fIparent\fR when the first window was created.This is not always the same as the X window hierarchy. Forexample, a pop-upis created as a child of the root window, but its logical parent willusually be a window within the application..PPThe procedure \fBTk_NameToWindow\fR returns the token for a windowgiven its path name (the \fIpathName\fR argument) and another windowbelonging to the same main window (\fItkwin\fR). It normallyreturns a token for the named window, but if no such window exists\fBTk_NameToWindow\fR leaves an error message in \fIinterp->result\fRand returns NULL. The \fItkwin\fR argument to \fBTk_NameToWindow\fRis needed because path names are only unique within a singleapplication hierarchy. If, for example, a single process has openedtwo main windows, each will have a separate naming hierarchy and thesame path name might appear in each of the hierarchies. Normally\fItkwin\fR is the main window of the desired hierarchy, but thisneed not be the case: any window in the desired hierarchy may be used..SH KEYWORDSname, path name, token, window
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -