Perl/Tk applications (which have windows associated with them) create
one or more <B>MainWindowB>s which act as the containers and parents
of the other widgets.
<B>Tk::MainWindowB> is a special kind of Toplevel widget. It is
the root of a widget tree. Therefore $mw->Parent returns
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 " #n" is appended where the number n is set to get
a unique value.
Unlike the standard Tcl/Tks wish, perl/Tk allows you to create
several MainWindows. When the last <B>MainWindowB> is destroyed
the Tk eventloop exits (the eventloop is entered with the call of
MainLoop). 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.