stk/Help/toplevel.n.html

162 lines
7.2 KiB
HTML

<HTML><HEAD><TITLE>Tk Built-In Commands - toplevel manual page</TITLE></HEAD>
<BR>
<BODY bgcolor = #c3c3ff>
<H2><IMG ALIGN=BOTTOM SRC="./Img/ManPageBlue.gif"> toplevel</H2>
<I>Create and manipulate toplevel widgets</I><P><IMG ALIGN=TOP SRC="./Img/line-red.gif">
<H3><A NAME="M2">SYNOPSIS</A></H3>
(<B>toplevel</B><I> widget-name </I>?<I>options</I>?)<BR>
<H3><A NAME="M3">STANDARD OPTIONS</A></H3>
<PRE>
<B><A HREF="options.n.html#M:borderwidth">:borderwidth</A></B> <B><A HREF="options.n.html#M:cursor">:cursor</A></B>
<B><A HREF="options.n.html#M:highlightbackground">:highlightbackground</A></B> <B><A HREF="options.n.html#M:highlightcolor">:highlightcolor</A></B>
<B><A HREF="options.n.html#M:highlightthickness">:highlightthickness</A></B> <B><A HREF="options.n.html#M:relief">:relief</A></B>
<B><A HREF="options.n.html#M:takefocus">:takefocus</A></B>
</PRE>
<H3><A NAME="M11">WIDGET-SPECIFIC OPTIONS</A></H3>
<DL>
<P>
<DT><I>Name</I>: <B>background</B>
<DT><I>Class</I>: <B>Background</B>
<DT><I>Option keyword</I>: <B><A NAME="M12">:background</A></B>
<DT><I>STklos slot name</I>: <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>
<P>
<DT><I>Name</I>: <B>class</B>
<DT><I>Class</I>: <B>Class</B>
<DT><I>Option keyword</I>: <B><A NAME="M13">:class</A></B>
<DT><I>STklos slot name</I>: <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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>colormap</B>
<DT><I>Class</I>: <B>Colormap</B>
<DT><I>Option keyword</I>: <B><A NAME="M14">:colormap</A></B>
<DT><I>STklos slot name</I>: <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>widget-name</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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>height</B>
<DT><I>Class</I>: <B>Height</B>
<DT><I>Option keyword</I>: <B><A NAME="M15">:height</A></B>
<DT><I>STklos slot name</I>: <B>height</B>
<DD>Specifies the desired height for the window in any of the forms
acceptable to <B>Tk_GetPixels</B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P>
<P>
<DT><I>Name</I>: <B></B>
<DT><I>Class</I>: <B></B>
<DT><I>Option keyword</I>: <B><A NAME="M16">:screen</A></B>
<DT><I>STklos slot name</I>: <B></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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>visual</B>
<DT><I>Class</I>: <B>Visual</B>
<DT><I>Option keyword</I>: <B><A NAME="M17">:visual</A></B>
<DT><I>STklos slot name</I>: <B>visual</B>
<DD>Specifies visual information for the new window in any of the
forms accepted by <B>Tk_GetVisual</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 procedure.
<P>
<P>
<DT><I>Name</I>: <B>width</B>
<DT><I>Class</I>: <B>Width</B>
<DT><I>Option keyword</I>: <B><A NAME="M18">:width</A></B>
<DT><I>STklos slot name</I>: <B>width</B>
<DD>Specifies the desired width for the window in any of the forms
acceptable to <B>Tk_GetPixels</B>.
If this option is less than or equal to zero then the window will
not request any size at all.
<P>
</DL>
<H3><A NAME="M19">DESCRIPTION</A></H3>
The <B>toplevel</B> procedure creates a new toplevel widget (given
by the <I>widget-name</I> argument). Additional
options, described above, may be specified on the procedure line
or in the option database
to configure aspects of the toplevel such as its background color
and relief. The <B>toplevel</B> procedure 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="M20">WIDGET PROCEDURE</A></H3>
The <B>toplevel</B> procedure creates a new STk procedure whose
name is the same as the path name of the toplevel's window. This
procedure may be used to invoke various
operations on the widget. It has the following general form:
<PRE>(<I>widget-name option </I>?<I>arg arg ...</I>?)</PRE>
<I>PathName</I> is the name of the procedure, 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 procedure. The following
procedures are possible for toplevel widgets:
<P>
<DL>
<DT><A NAME="M21">(<I>widget-name '</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>
procedure.
<P>
<DT><A NAME="M22">(<I>widget-name '</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>widget-name</I> (see <B>Tk_ConfigureInfo</B> for
information on the format of this list). If <I>option</I> is specified
with no <I>value</I>, then the procedure 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 procedure
modifies the given widget option(s) to have the given value(s); in
this case the procedure returns an empty string.
<I>Option</I> may have any of the values accepted by the <B>toplevel</B>
procedure.
<P>
</DL>
<H3><A NAME="M23">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="M24">SEE ALSO</A></H3>
<B><A HREF="./wm.n.html">wm</A></B>
<P><IMG ALIGN=TOP SRC="./Img/line-red.gif"><P>
<A HREF=./STk-hlp.html><IMG ALIGN=BOTTOM SRC="./Img/RefBookBlue.gif"> Back to the <B>STk</B> main page</A>
</BODY></HTML>