212 lines
11 KiB
HTML
212 lines
11 KiB
HTML
<HTML><HEAD><TITLE>Tk Built-In Commands - toplevel manual page</TITLE></HEAD><BODY>
|
|
<DL>
|
|
<DD><A HREF="toplevel.htm#M2" NAME="L1210">NAME</A>
|
|
<DL><DD>toplevel - Create and manipulate toplevel widgets</DL>
|
|
<DD><A HREF="toplevel.htm#M3" NAME="L1211">SYNOPSIS</A>
|
|
<DL>
|
|
<DD><B>toplevel</B> <I>pathName </I>?<I>options</I>?
|
|
</DL>
|
|
<DD><A HREF="toplevel.htm#M4" NAME="L1212">STANDARD OPTIONS</A>
|
|
<DL>
|
|
<DD><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A>
|
|
<DD><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A>
|
|
<DD><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A>
|
|
<DD><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A>
|
|
<DD><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A>
|
|
<DD><A HREF="options.htm#M-relief">-relief, relief, Relief</A>
|
|
<DD><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A>
|
|
</DL>
|
|
<DD><A HREF="toplevel.htm#M5" NAME="L1213">WIDGET-SPECIFIC OPTIONS</A>
|
|
<DL>
|
|
<DD><A HREF="toplevel.htm#M6" NAME="L1214">-background, background, Background</A>
|
|
<DD><A HREF="toplevel.htm#M7" NAME="L1215">-class, class, Class</A>
|
|
<DD><A HREF="toplevel.htm#M8" NAME="L1216">-colormap, colormap, Colormap</A>
|
|
<DD><A HREF="toplevel.htm#M9" NAME="L1217">-container, container, Container</A>
|
|
<DD><A HREF="toplevel.htm#M10" NAME="L1218">-height, height, Height</A>
|
|
<DD><A HREF="toplevel.htm#M11" NAME="L1219">-menu, menu, Menu</A>
|
|
<DD><A HREF="toplevel.htm#M12" NAME="L1220">-screen, , </A>
|
|
<DD><A HREF="toplevel.htm#M13" NAME="L1221">-use, use, Use</A>
|
|
<DD><A HREF="toplevel.htm#M14" NAME="L1222">-visual, visual, Visual</A>
|
|
<DD><A HREF="toplevel.htm#M15" NAME="L1223">-width, width, Width</A>
|
|
</DL>
|
|
<DD><A HREF="toplevel.htm#M16" NAME="L1224">DESCRIPTION</A>
|
|
<DD><A HREF="toplevel.htm#M17" NAME="L1225">WIDGET COMMAND</A>
|
|
<DL>
|
|
<DD><A HREF="toplevel.htm#M18" NAME="L1226"><I>pathName </I><B>cget</B> <I>option</I></A>
|
|
<DD><A HREF="toplevel.htm#M19" NAME="L1227"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A>
|
|
</DL>
|
|
<DD><A HREF="toplevel.htm#M20" NAME="L1228">BINDINGS</A>
|
|
<DD><A HREF="toplevel.htm#M21" NAME="L1229">KEYWORDS</A>
|
|
</DL><HR>
|
|
<H3><A NAME="M2">NAME</A></H3>
|
|
toplevel - Create and manipulate toplevel widgets
|
|
<H3><A NAME="M3">SYNOPSIS</A></H3>
|
|
<B>toplevel</B> <I>pathName </I>?<I>options</I>?<BR>
|
|
<H3><A NAME="M4">STANDARD OPTIONS</A></H3>
|
|
<DL>
|
|
<DT><B><A HREF="options.htm#M-borderwidth">-borderwidth or -bd, borderWidth, BorderWidth</A></B>
|
|
<DT><B><A HREF="options.htm#M-cursor">-cursor, cursor, Cursor</A></B>
|
|
<DT><B><A HREF="options.htm#M-highlightbackground">-highlightbackground, highlightBackground, HighlightBackground</A></B>
|
|
<DT><B><A HREF="options.htm#M-highlightcolor">-highlightcolor, highlightColor, HighlightColor</A></B>
|
|
<DT><B><A HREF="options.htm#M-highlightthickness">-highlightthickness, highlightThickness, HighlightThickness</A></B>
|
|
<DT><B><A HREF="options.htm#M-relief">-relief, relief, Relief</A></B>
|
|
<DT><B><A HREF="options.htm#M-takefocus">-takefocus, takeFocus, TakeFocus</A></B>
|
|
</DL>
|
|
<H3><A NAME="M5">WIDGET-SPECIFIC OPTIONS</A></H3>
|
|
<DL>
|
|
<DT>Command-Line Name: <B><A NAME="M6">-background</A></B>
|
|
<DT>Database Name: <B>background</B>
|
|
<DT>Database Class: <B>Background</B>
|
|
<DD>This option is the same as the standard <B>background</B> option
|
|
except that its value may also be specified as an empty string.
|
|
In this case, the widget will display no background or border, and
|
|
no colors will be consumed from its colormap for its background
|
|
and border.
|
|
<P><DT>Command-Line Name: <B><A NAME="M7">-class</A></B>
|
|
<DT>Database Name: <B>class</B>
|
|
<DT>Database Class: <B>Class</B>
|
|
<DD>Specifies a class for the window.
|
|
This class will be used when querying the option database for
|
|
the window's other options, and it will also be used later for
|
|
other purposes such as bindings.
|
|
The <B>class</B> option may not be changed with the <B>configure</B>
|
|
widget command.
|
|
<P><DT>Command-Line Name: <B><A NAME="M8">-colormap</A></B>
|
|
<DT>Database Name: <B>colormap</B>
|
|
<DT>Database Class: <B>Colormap</B>
|
|
<DD>Specifies a colormap to use for the window.
|
|
The value may be either <B>new</B>, in which case a new colormap is
|
|
created for the window and its children, or the name of another
|
|
window (which must be on the same screen and have the same visual
|
|
as <I>pathName</I>), in which case the new window will use the colormap
|
|
from the specified window.
|
|
If the <B>colormap</B> option is not specified, the new window
|
|
uses the default colormap of its screen.
|
|
This option may not be changed with the <B>configure</B>
|
|
widget command.
|
|
<P><DT>Command-Line Name: <B><A NAME="M9">-container</A></B>
|
|
<DT>Database Name: <B>container</B>
|
|
<DT>Database Class: <B>Container</B>
|
|
<DD>The value must be a boolean. If true, it means that this window will
|
|
be used as a container in which some other application will be embedded
|
|
(for example, a Tk toplevel can be embedded using the <B>-use</B> option).
|
|
The window will support the appropriate window manager protocols for
|
|
things like geometry requests. The window should not have any
|
|
children of its own in this application.
|
|
This option may not be changed with the <B>configure</B>
|
|
widget command.
|
|
<P><DT>Command-Line Name: <B><A NAME="M10">-height</A></B>
|
|
<DT>Database Name: <B>height</B>
|
|
<DT>Database Class: <B>Height</B>
|
|
<DD>Specifies the desired height for the window in any of the forms
|
|
acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
|
|
If this option is less than or equal to zero then the window will
|
|
not request any size at all.
|
|
<P><DT>Command-Line Name: <B><A NAME="M11">-menu</A></B>
|
|
<DT>Database Name: <B><A HREF="../TclCmd/menu.htm">menu</A></B>
|
|
<DT>Database Class: <B><A HREF="../TclCmd/menu.htm">Menu</A></B>
|
|
<DD>Specifies a menu widget to be used as a menubar. On the Macintosh, the
|
|
menubar will be displayed accross the top of the main monitor. On
|
|
Microsoft Windows and all UNIX platforms, the menu will appear accross
|
|
the toplevel window as part of the window dressing maintained by the
|
|
window manager.
|
|
<P><DT>Command-Line Name: <B><A NAME="M12">-screen</A></B>
|
|
<DT>Database Name: <B><A HREF="../TkLib/CrtChannel.htm"></A></B>
|
|
<DT>Database Class: <B><A HREF="../TkLib/CrtChannel.htm"></A></B>
|
|
<DD>Specifies the screen on which to place the new window.
|
|
Any valid screen name may be used, even one associated with a
|
|
different display.
|
|
Defaults to the same screen as its parent.
|
|
This option is special in that it may not be specified via the option
|
|
database, and it may not be modified with the <B>configure</B>
|
|
widget command.
|
|
<P><DT>Command-Line Name: <B><A NAME="M13">-use</A></B>
|
|
<DT>Database Name: <B>use</B>
|
|
<DT>Database Class: <B>Use</B>
|
|
<DD>This 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 as
|
|
a hexadecimal string like the ones returned by the <B><A HREF="../TclCmd/winfo.htm">winfo id</A></B>
|
|
command. The toplevel widget will be created as a child of the given
|
|
container instead of the root window for the screen. If the container
|
|
window is in a Tk application, it must be a frame or toplevel widget for
|
|
which the <B>-container</B> option was specified.
|
|
This option may not be changed with the <B>configure</B>
|
|
widget command.
|
|
<P><DT>Command-Line Name: <B><A NAME="M14">-visual</A></B>
|
|
<DT>Database Name: <B>visual</B>
|
|
<DT>Database Class: <B>Visual</B>
|
|
<DD>Specifies visual information for the new window in any of the
|
|
forms accepted by <B><A HREF="../TclLib/GetVisual.htm">Tk_GetVisual</A></B>.
|
|
If this option is not specified, the new window will use the default
|
|
visual for its screen.
|
|
The <B>visual</B> option may not be modified with the <B>configure</B>
|
|
widget command.
|
|
<P><DT>Command-Line Name: <B><A NAME="M15">-width</A></B>
|
|
<DT>Database Name: <B>width</B>
|
|
<DT>Database Class: <B>Width</B>
|
|
<DD>Specifies the desired width for the window in any of the forms
|
|
acceptable to <B><A HREF="../TclLib/GetPixels.htm">Tk_GetPixels</A></B>.
|
|
If this option is less than or equal to zero then the window will
|
|
not request any size at all.
|
|
</DL>
|
|
<H3><A NAME="M16">DESCRIPTION</A></H3>
|
|
The <B>toplevel</B> command creates a new toplevel widget (given
|
|
by the <I>pathName</I> argument). Additional
|
|
options, described above, may be specified on the command line
|
|
or in the option database
|
|
to configure aspects of the toplevel such as its background color
|
|
and relief. The <B>toplevel</B> command returns the
|
|
path name of the new window.
|
|
<P>
|
|
A toplevel is similar to a frame except that it is created as a
|
|
top-level window: its X parent is the root window of a screen
|
|
rather than the logical parent from its path name. The primary
|
|
purpose of a toplevel is to serve as a container for dialog boxes
|
|
and other collections of widgets. The only visible features
|
|
of a toplevel are its background color and an optional 3-D border
|
|
to make the toplevel appear raised or sunken.
|
|
|
|
<H3><A NAME="M17">WIDGET COMMAND</A></H3>
|
|
The <B>toplevel</B> command creates a new Tcl command whose
|
|
name is the same as the path name of the toplevel's window. This
|
|
command may be used to invoke various
|
|
operations on the widget. It has the following general form:
|
|
<PRE><I>pathName option </I>?<I>arg arg ...</I>?</PRE>
|
|
<I>PathName</I> is the name of the command, which is the same as
|
|
the toplevel widget's path name. <I>Option</I> and the <I>arg</I>s
|
|
determine the exact behavior of the command. The following
|
|
commands are possible for toplevel widgets:
|
|
<P>
|
|
<DL>
|
|
<P><DT><A NAME="M18"><I>pathName </I><B>cget</B> <I>option</I></A><DD>
|
|
Returns the current value of the configuration option given
|
|
by <I>option</I>.
|
|
<I>Option</I> may have any of the values accepted by the <B>toplevel</B>
|
|
command.
|
|
<P><DT><A NAME="M19"><I>pathName </I><B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?</A><DD>
|
|
Query or modify the configuration options of the widget.
|
|
If no <I>option</I> is specified, returns a list describing all of
|
|
the available options for <I>pathName</I> (see <B><A HREF="../TclLib/ConfigWidg.htm">Tk_ConfigureInfo</A></B> for
|
|
information on the format of this list). If <I>option</I> is specified
|
|
with no <I>value</I>, then the command returns a list describing the
|
|
one named option (this list will be identical to the corresponding
|
|
sublist of the value returned if no <I>option</I> is specified). If
|
|
one or more <I>option-value</I> pairs are specified, then the command
|
|
modifies the given widget option(s) to have the given value(s); in
|
|
this case the command returns an empty string.
|
|
<I>Option</I> may have any of the values accepted by the <B>toplevel</B>
|
|
command.
|
|
|
|
<P></DL>
|
|
<H3><A NAME="M20">BINDINGS</A></H3>
|
|
When a new toplevel is created, it has no default event bindings:
|
|
toplevels are not intended to be interactive.
|
|
|
|
<H3><A NAME="M21">KEYWORDS</A></H3>
|
|
<A href="../Keywords/T.htm#toplevel">toplevel</A>, <A href="../Keywords/W.htm#widget">widget</A>
|
|
<HR><PRE>
|
|
<A HREF="../copyright.htm">Copyright</A> © 1990-1994 The Regents of the University of California.
|
|
<A HREF="../copyright.htm">Copyright</A> © 1994-1996 Sun Microsystems, Inc.
|
|
<A HREF="../copyright.htm">Copyright</A> © 1995-1997 Roger E. Critchlow Jr.</PRE>
|
|
</BODY></HTML>
|