1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1990-1994 The Regents of the University of California.
|
3 |
|
|
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
4 |
|
|
'\"
|
5 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
6 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
7 |
|
|
'\"
|
8 |
|
|
'\" RCS: @(#) $Id: toplevel.n,v 1.1.1.1 2002-01-16 10:25:50 markom Exp $
|
9 |
|
|
'\"
|
10 |
|
|
.so man.macros
|
11 |
|
|
.TH toplevel n 8.0 Tk "Tk Built-In Commands"
|
12 |
|
|
.BS
|
13 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
14 |
|
|
.SH NAME
|
15 |
|
|
toplevel \- Create and manipulate toplevel widgets
|
16 |
|
|
.SH SYNOPSIS
|
17 |
|
|
\fBtoplevel\fR \fIpathName \fR?\fIoptions\fR?
|
18 |
|
|
.SO
|
19 |
|
|
\-borderwidth \-highlightbackground \-highlightthickness \-takefocus
|
20 |
|
|
\-cursor \-highlightcolor \-relief
|
21 |
|
|
.SE
|
22 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
23 |
|
|
.OP \-background background Background
|
24 |
|
|
This option is the same as the standard \fBbackground\fR option
|
25 |
|
|
except that its value may also be specified as an empty string.
|
26 |
|
|
In this case, the widget will display no background or border, and
|
27 |
|
|
no colors will be consumed from its colormap for its background
|
28 |
|
|
and border.
|
29 |
|
|
.OP \-class class Class
|
30 |
|
|
Specifies a class for the window.
|
31 |
|
|
This class will be used when querying the option database for
|
32 |
|
|
the window's other options, and it will also be used later for
|
33 |
|
|
other purposes such as bindings.
|
34 |
|
|
The \fBclass\fR option may not be changed with the \fBconfigure\fR
|
35 |
|
|
widget command.
|
36 |
|
|
.OP \-colormap colormap Colormap
|
37 |
|
|
Specifies a colormap to use for the window.
|
38 |
|
|
The value may be either \fBnew\fR, in which case a new colormap is
|
39 |
|
|
created for the window and its children, or the name of another
|
40 |
|
|
window (which must be on the same screen and have the same visual
|
41 |
|
|
as \fIpathName\fR), in which case the new window will use the colormap
|
42 |
|
|
from the specified window.
|
43 |
|
|
If the \fBcolormap\fR option is not specified, the new window
|
44 |
|
|
uses the default colormap of its screen.
|
45 |
|
|
This option may not be changed with the \fBconfigure\fR
|
46 |
|
|
widget command.
|
47 |
|
|
.VS 8.0 br
|
48 |
|
|
.OP \-container container Container
|
49 |
|
|
The value must be a boolean. If true, it means that this window will
|
50 |
|
|
be used as a container in which some other application will be embedded
|
51 |
|
|
(for example, a Tk toplevel can be embedded using the \fB\-use\fR option).
|
52 |
|
|
The window will support the appropriate window manager protocols for
|
53 |
|
|
things like geometry requests. The window should not have any
|
54 |
|
|
children of its own in this application.
|
55 |
|
|
This option may not be changed with the \fBconfigure\fR
|
56 |
|
|
widget command.
|
57 |
|
|
.VE
|
58 |
|
|
.OP \-height height Height
|
59 |
|
|
Specifies the desired height for the window in any of the forms
|
60 |
|
|
acceptable to \fBTk_GetPixels\fR.
|
61 |
|
|
If this option is less than or equal to zero then the window will
|
62 |
|
|
not request any size at all.
|
63 |
|
|
.VS 8.0 br
|
64 |
|
|
.OP \-menu menu Menu
|
65 |
|
|
Specifies a menu widget to be used as a menubar. On the Macintosh, the
|
66 |
|
|
menubar will be displayed accross the top of the main monitor. On
|
67 |
|
|
Microsoft Windows and all UNIX platforms, the menu will appear accross
|
68 |
|
|
the toplevel window as part of the window dressing maintained by the
|
69 |
|
|
window manager.
|
70 |
|
|
.VE
|
71 |
|
|
.OP \-screen "" ""
|
72 |
|
|
Specifies the screen on which to place the new window.
|
73 |
|
|
Any valid screen name may be used, even one associated with a
|
74 |
|
|
different display.
|
75 |
|
|
Defaults to the same screen as its parent.
|
76 |
|
|
This option is special in that it may not be specified via the option
|
77 |
|
|
database, and it may not be modified with the \fBconfigure\fR
|
78 |
|
|
widget command.
|
79 |
|
|
.VS 8.0 br
|
80 |
|
|
.OP \-use use Use
|
81 |
|
|
This option is used for embedding. If the value isn't an empty string,
|
82 |
|
|
it must be the the window identifier of a container window, specified as
|
83 |
|
|
a hexadecimal string like the ones returned by the \fBwinfo id\fR
|
84 |
|
|
command. The toplevel widget will be created as a child of the given
|
85 |
|
|
container instead of the root window for the screen. If the container
|
86 |
|
|
window is in a Tk application, it must be a frame or toplevel widget for
|
87 |
|
|
which the \fB\-container\fR option was specified.
|
88 |
|
|
This option may not be changed with the \fBconfigure\fR
|
89 |
|
|
widget command.
|
90 |
|
|
.VE
|
91 |
|
|
.OP \-visual visual Visual
|
92 |
|
|
Specifies visual information for the new window in any of the
|
93 |
|
|
forms accepted by \fBTk_GetVisual\fR.
|
94 |
|
|
If this option is not specified, the new window will use the default
|
95 |
|
|
visual for its screen.
|
96 |
|
|
The \fBvisual\fR option may not be modified with the \fBconfigure\fR
|
97 |
|
|
widget command.
|
98 |
|
|
.OP \-width width Width
|
99 |
|
|
Specifies the desired width for the window in any of the forms
|
100 |
|
|
acceptable to \fBTk_GetPixels\fR.
|
101 |
|
|
If this option is less than or equal to zero then the window will
|
102 |
|
|
not request any size at all.
|
103 |
|
|
.BE
|
104 |
|
|
|
105 |
|
|
.SH DESCRIPTION
|
106 |
|
|
.PP
|
107 |
|
|
The \fBtoplevel\fR command creates a new toplevel widget (given
|
108 |
|
|
by the \fIpathName\fR argument). Additional
|
109 |
|
|
options, described above, may be specified on the command line
|
110 |
|
|
or in the option database
|
111 |
|
|
to configure aspects of the toplevel such as its background color
|
112 |
|
|
and relief. The \fBtoplevel\fR command returns the
|
113 |
|
|
path name of the new window.
|
114 |
|
|
.PP
|
115 |
|
|
A toplevel is similar to a frame except that it is created as a
|
116 |
|
|
top-level window: its X parent is the root window of a screen
|
117 |
|
|
rather than the logical parent from its path name. The primary
|
118 |
|
|
purpose of a toplevel is to serve as a container for dialog boxes
|
119 |
|
|
and other collections of widgets. The only visible features
|
120 |
|
|
of a toplevel are its background color and an optional 3-D border
|
121 |
|
|
to make the toplevel appear raised or sunken.
|
122 |
|
|
|
123 |
|
|
.SH "WIDGET COMMAND"
|
124 |
|
|
.PP
|
125 |
|
|
The \fBtoplevel\fR command creates a new Tcl command whose
|
126 |
|
|
name is the same as the path name of the toplevel's window. This
|
127 |
|
|
command may be used to invoke various
|
128 |
|
|
operations on the widget. It has the following general form:
|
129 |
|
|
.CS
|
130 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
131 |
|
|
.CE
|
132 |
|
|
\fIPathName\fR is the name of the command, which is the same as
|
133 |
|
|
the toplevel widget's path name. \fIOption\fR and the \fIarg\fRs
|
134 |
|
|
determine the exact behavior of the command. The following
|
135 |
|
|
commands are possible for toplevel widgets:
|
136 |
|
|
.TP
|
137 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
138 |
|
|
Returns the current value of the configuration option given
|
139 |
|
|
by \fIoption\fR.
|
140 |
|
|
\fIOption\fR may have any of the values accepted by the \fBtoplevel\fR
|
141 |
|
|
command.
|
142 |
|
|
.TP
|
143 |
|
|
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
144 |
|
|
Query or modify the configuration options of the widget.
|
145 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
146 |
|
|
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
147 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
148 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
149 |
|
|
one named option (this list will be identical to the corresponding
|
150 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
151 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
152 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
153 |
|
|
this case the command returns an empty string.
|
154 |
|
|
\fIOption\fR may have any of the values accepted by the \fBtoplevel\fR
|
155 |
|
|
command.
|
156 |
|
|
|
157 |
|
|
.SH BINDINGS
|
158 |
|
|
.PP
|
159 |
|
|
When a new toplevel is created, it has no default event bindings:
|
160 |
|
|
toplevels are not intended to be interactive.
|
161 |
|
|
|
162 |
|
|
.SH KEYWORDS
|
163 |
|
|
toplevel, widget
|