Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / sun4-solaris / Tk / MainWindow.pod
CommitLineData
86530b38
AT
1
2=head1 NAME
3
4Tk::MainWindow - Root widget of a widget tree
5
6=for pm Tk/MainWindow.pm
7
8=for category Creating and Configuring Widgets
9
10=head1 SYNOPSIS
11
12 use Tk;
13
14 my $mw = MainWindow->new( ... options ... );
15
16 my $this = $mw->ThisWidget -> pack ;
17 my $that = $mw->ThatWidget;
18 ...
19
20 MainLoop;
21
22=head1 DESCRIPTION
23
24Perl/Tk applications (which have windows associated with them) create
25one or more B<MainWindow>s which act as the containers and parents
26of the other widgets.
27
28B<Tk::MainWindow> is a special kind of L<Toplevel|Tk::Toplevel> widget. It is
29the root of a widget tree. Therefore C<$mw-E<gt>Parent> returns
30C<undef>.
31
32The default title of a MainWindow is the basename of the script
33(actually the Class name used for options lookup, i.e. with basename
34with inital caps) or 'Ptk' as the fallback value. If more than one MainWindow is created
35or several instances of the script are running at the same time the
36string C<" #n"> is appended where the number C<n> is set to get
37a unique value.
38
39Unlike the standard Tcl/Tk's wish, perl/Tk allows you to create
40several MainWindows. When the I<last> B<MainWindow> is destroyed
41the Tk eventloop exits (the eventloop is entered with the call of
42C<MainLoop>). Various resources (bindings, fonts, images, colors) are
43maintained or cached for each MainWindow, so each MainWindow consumes more
44resources than a Toplevel. However multiple MainWindows can make sense when
45the user can destroy them independently.
46
47=head1 METHODS
48
49You can apply all methods that a L<Toplevel|Tk::Toplevel> widget accepts.
50
51The method I<$w>-E<gt>B<MainWindow> applied to any widget will return the
52B<MainWindow> to which the widget belongs (the MainWindow belongs to itself).
53
54=head1 MISSING
55
56Documentation is incomplete.
57Here are I<some> missing items that should be explained in
58more detail:
59
60=over 4
61
62=item *
63
64The new mechanism for MainWindows is slightly different to
65other widgets.
66
67=item *
68
69There no explanation about what resources are bound
70to a MainWindow (e.g., ClassInit done per MainWindow)
71
72=item *
73
74Passing of command line options to override or augment
75arguments of the C<new> method (see L<Tk::CmdLine>).
76
77=back
78
79=head1 SEE ALSO
80
81L<Tk::Toplevel|Tk::Toplevel>
82L<Tk::CmdLine|Tk::CmdLine>
83
84=cut
85