home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_ab378bf335e5620205f08e99306009cc
< prev
next >
Wrap
Text File
|
2000-03-23
|
4KB
|
116 lines
<HTML>
<HEAD>
<TITLE>Tk::MainWindow - Root widget of a widget tree</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Tk::MainWindow - Root widget of a widget tree</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#methods">METHODS</A></LI>
<LI><A HREF="#missing">MISSING</A></LI>
<LI><A HREF="#see also">SEE ALSO</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Tk::MainWindow - Root widget of a widget tree</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
use Tk;</PRE>
<PRE>
my $mw = MainWindow->new( ... options ... );</PRE>
<PRE>
my $this = $mw->ThisWidget -> pack ;
my $that = $mw->ThatWidget;
...</PRE>
<PRE>
MainLoop;</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>Perl/Tk applications (which have windows associated with them) create
one or more <STRONG>MainWindow</STRONG>s which act as the containers and parents
of the other widgets.</P>
<P><STRONG>Tk::MainWindow</STRONG> is a special kind of <A HREF="../../../site/lib/Tk/Toplevel.html">Toplevel</A> widget. It is
the root of a widget tree. Therefore <CODE>$mw->Parent</CODE> returns
<A HREF="../../../lib/Pod/perlfunc.html#item_undef"><CODE>undef</CODE></A>.</P>
<P>The default title of a MainWindow is the basename of the script
(actually the Class name used for options lookup, i.e. with basename
with inital caps) or 'Ptk' as the fallback value. If more than one MainWindow is created
or several instances of the script are running at the same time the
string <CODE>" #n"</CODE> is appended where the number <CODE>n</CODE> is set to get
a unique value.</P>
<P>Unlike the standard Tcl/Tk's wish, perl/Tk allows you to create
several MainWindows. When the <EM>last</EM> <STRONG>MainWindow</STRONG> is destroyed
the Tk eventloop exits (the eventloop is entered with the call of
<CODE>MainLoop</CODE>). Various resources (bindings, fonts, images, colors) are
maintained or cached for each MainWindow, so each MainWindow consumes more
resources than a Toplevel. However multiple MainWindows can make sense when
the user can destroy them independently.</P>
<P>
<HR>
<H1><A NAME="methods">METHODS</A></H1>
<P>You can apply all methods that a <A HREF="../../../site/lib/Tk/Toplevel.html">Toplevel</A> widget accepts.</P>
<P>The method <EM>$w</EM>-><STRONG>MainWindow</STRONG> applied to any widget will return the
<STRONG>MainWindow</STRONG> to which the widget belongs (the MainWindow belongs to itself).</P>
<P>
<HR>
<H1><A NAME="missing">MISSING</A></H1>
<P>Documentation is incomplete.
Here are <EM>some</EM> missing items that should be explained in
more detail:</P>
<UL>
<LI>
The new mechanism for MainWindows is slightly different to
other widgets.
<P></P>
<LI>
There no explanation about what resources are bound
to a MainWindow (e.g., ClassInit done per MainWindow)
<P></P>
<LI>
Passing of command line options to override or augment
arguments of the <CODE>new</CODE> method (see <A HREF="../../../site/lib/Tk/CmdLine.html">the Tk::CmdLine manpage</A>).
<P></P></UL>
<P>
<HR>
<H1><A NAME="see also">SEE ALSO</A></H1>
<P><A HREF="../../../site/lib/Tk/Toplevel.html">Tk::Toplevel</A>
<A HREF="../../../site/lib/Tk/CmdLine.html">Tk::CmdLine</A></P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Tk::MainWindow - Root widget of a widget tree</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>