📄 toplevel.n
字号:
'\"'\" Copyright (c) 1990-1994 The Regents of the University of California.'\" Copyright (c) 1994-1996 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: @(#) toplevel.n 1.29 97/10/31 12:58:53'\" .so man.macros.TH toplevel n 8.0 Tk "Tk Built-In Commands".BS'\" Note: do not modify the .SH NAME line immediately below!.SH NAMEtoplevel \- Create and manipulate toplevel widgets.SH SYNOPSIS\fBtoplevel\fR \fIpathName \fR?\fIoptions\fR?.SO\-borderwidth \-highlightbackground \-highlightthickness \-takefocus\-cursor \-highlightcolor \-relief.SE.SH "WIDGET-SPECIFIC OPTIONS".OP \-background background BackgroundThis option is the same as the standard \fBbackground\fR optionexcept that its value may also be specified as an empty string.In this case, the widget will display no background or border, andno colors will be consumed from its colormap for its backgroundand border..OP \-class class ClassSpecifies a class for the window.This class will be used when querying the option database forthe window's other options, and it will also be used later forother purposes such as bindings.The \fBclass\fR option may not be changed with the \fBconfigure\fRwidget command..OP \-colormap colormap ColormapSpecifies a colormap to use for the window.The value may be either \fBnew\fR, in which case a new colormap iscreated for the window and its children, or the name of anotherwindow (which must be on the same screen and have the same visualas \fIpathName\fR), in which case the new window will use the colormapfrom the specified window.If the \fBcolormap\fR option is not specified, the new windowuses the default colormap of its screen.This option may not be changed with the \fBconfigure\fRwidget command..VS 8.0 br.OP \-container container ContainerThe value must be a boolean. If true, it means that this window willbe used as a container in which some other application will be embedded(for example, a Tk toplevel can be embedded using the \fB\-use\fR option).The window will support the appropriate window manager protocols forthings like geometry requests. The window should not have anychildren of its own in this application.This option may not be changed with the \fBconfigure\fRwidget command..VE.OP \-height height HeightSpecifies the desired height for the window in any of the formsacceptable to \fBTk_GetPixels\fR.If this option is less than or equal to zero then the window willnot request any size at all..VS 8.0 br.OP \-menu menu MenuSpecifies a menu widget to be used as a menubar. On the Macintosh, themenubar will be displayed accross the top of the main monitor. OnMicrosoft Windows and all UNIX platforms, the menu will appear accrossthe toplevel window as part of the window dressing maintained by thewindow manager..VE.OP \-screen "" ""Specifies the screen on which to place the new window.Any valid screen name may be used, even one associated with adifferent display.Defaults to the same screen as its parent.This option is special in that it may not be specified via the optiondatabase, and it may not be modified with the \fBconfigure\fRwidget command..VS 8.0 br.OP \-use use UseThis option is used for embedding. If the value isn't an empty string,it must be the the window identifier of a container window, specified asa hexadecimal string like the ones returned by the \fBwinfo id\fRcommand. The toplevel widget will be created as a child of the givencontainer instead of the root window for the screen. If the containerwindow is in a Tk application, it must be a frame or toplevel widget forwhich the \fB\-container\fR option was specified.This option may not be changed with the \fBconfigure\fRwidget command..VE.OP \-visual visual VisualSpecifies visual information for the new window in any of theforms accepted by \fBTk_GetVisual\fR.If this option is not specified, the new window will use the defaultvisual for its screen.The \fBvisual\fR option may not be modified with the \fBconfigure\fRwidget command..OP \-width width WidthSpecifies the desired width for the window in any of the formsacceptable to \fBTk_GetPixels\fR.If this option is less than or equal to zero then the window willnot request any size at all..BE.SH DESCRIPTION.PPThe \fBtoplevel\fR command creates a new toplevel widget (givenby the \fIpathName\fR argument). Additionaloptions, described above, may be specified on the command lineor in the option databaseto configure aspects of the toplevel such as its background colorand relief. The \fBtoplevel\fR command returns thepath name of the new window..PPA toplevel is similar to a frame except that it is created as atop-level window: its X parent is the root window of a screenrather than the logical parent from its path name. The primarypurpose of a toplevel is to serve as a container for dialog boxesand other collections of widgets. The only visible featuresof a toplevel are its background color and an optional 3-D borderto make the toplevel appear raised or sunken..SH "WIDGET COMMAND".PPThe \fBtoplevel\fR command creates a new Tcl command whosename is the same as the path name of the toplevel's window. Thiscommand may be used to invoke variousoperations on the widget. It has the following general form:.CS\fIpathName option \fR?\fIarg arg ...\fR?.CE\fIPathName\fR is the name of the command, which is the same asthe toplevel widget's path name. \fIOption\fR and the \fIarg\fRsdetermine the exact behavior of the command. The followingcommands are possible for toplevel widgets:.TP\fIpathName \fBcget\fR \fIoption\fRReturns the current value of the configuration option givenby \fIoption\fR.\fIOption\fR may have any of the values accepted by the \fBtoplevel\fRcommand..TP\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?Query or modify the configuration options of the widget.If no \fIoption\fR is specified, returns a list describing all ofthe available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR forinformation on the format of this list). If \fIoption\fR is specifiedwith no \fIvalue\fR, then the command returns a list describing theone named option (this list will be identical to the correspondingsublist of the value returned if no \fIoption\fR is specified). Ifone or more \fIoption\-value\fR pairs are specified, then the commandmodifies the given widget option(s) to have the given value(s); inthis case the command returns an empty string.\fIOption\fR may have any of the values accepted by the \fBtoplevel\fRcommand..SH BINDINGS.PPWhen a new toplevel is created, it has no default event bindings:toplevels are not intended to be interactive..SH KEYWORDStoplevel, widget
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -