Debian Codegraph @

pod/Toplevel.pod

raw
1 # Copyright (c) 1990-1994 The Regents of the University of California.
2 # Copyright (c) 1994-1996 Sun Microsystems, Inc.
3 # See the file "license.terms" for information on usage and redistribution
4 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
5 #
6 #
7
8 =head1 NAME
9
10 Tk::Toplevel - Create and manipulate Toplevel widgets
11
12 =for category Tk Widget Classes
13
14 =head1 SYNOPSIS
15
16 S< >I<$toplevel> = I<$parent>-E<gt>B<Toplevel>(?I<options>?);
17
18 =head1 STANDARD OPTIONS
19
20 B<-borderwidth> B<-highlightbackground> B<-highlightthickness> B<-takefocus>
21 B<-class> B<-highlightcolor> B<-relief>
22 B<-cursor>
23
24 See L<Tk::options> for details of the standard options.
25
26 =head1 WIDGET-SPECIFIC OPTIONS
27
28 =over 4
29
30 =item Name: B<background>
31
32 =item Class: B<Background>
33
34 =item Switch: B<-background>
35
36 This option is the same as the standard B<background> option
37 except that its value may also be specified as an undefined value.
38 In this case, the widget will display no background or border, and
39 no colors will be consumed from its colormap for its background
40 and border.
41
42 =item Name: B<colormap>
43
44 =item Class: B<Colormap>
45
46 =item Switch: B<-colormap>
47
48 Specifies a colormap to use for the window.
49 The value may be either B<new>, in which case a new colormap is
50 created for the window and its children, or the name of another
51 window (which must be on the same screen and have the same visual
52 as $widget), in which case the new window will use the colormap
53 from the specified window.
54 If the B<colormap> option is not specified, the new window
55 uses the default colormap of its screen.
56 This option may not be changed with the B<configure>
57 method.
58
59 =item Name: B<container>
60
61 =item Class: B<Container>
62
63 =item Switch: B<-container>
64
65 The value must be a boolean. If true, it means that this window will
66 be used as a container in which some other application will be embedded
67 (for example, a Tk toplevel can be embedded using the B<-use> option).
68 The window will support the appropriate window manager protocols for
69 things like geometry requests. The window should not have any
70 children of its own in this application.
71 This option may not be changed with the B<configure>
72 method.
73
74 =item Name: B<height>
75
76 =item Class: B<Height>
77
78 =item Switch: B<-height>
79
80 Specifies the desired height for the window in any of the forms
81 acceptable to B<Tk_GetPixels>.
82 If this option is less than or equal to zero then the window will
83 not request any size at all.
84
85 =item Name: B<menu>
86
87 =item Class: B<Menu>
88
89 =item Switch: B<-menu>
90
91 Specifies a menu widget to be used as a menubar. On the Macintosh, the
92 menubar will be displayed accross the top of the main monitor. On
93 Microsoft Windows and all UNIX platforms, the menu will appear accross
94 the toplevel window as part of the window dressing maintained by the
95 window manager.
96
97 =item Name: B<"">
98
99 =item Class: B<"">
100
101 =item Switch: B<-screen>
102
103 Specifies the screen on which to place the new window.
104 Any valid screen name may be used, even one associated with a
105 different display.
106 Defaults to the same screen as its parent.
107 This option is special in that it may not be specified via the option
108 database, and it may not be modified with the B<configure>
109 method.
110
111 =item Switch: B<-title>
112
113 Specifies the title of the toplevel window.
114
115 =item Name: B<use>
116
117 =item Class: B<Use>
118
119 =item Switch: B<-use>
120
121 This option is used for embedding. If the value isn't an empty string,
122 it must be the the window identifier of a container window, specified as
123 a hexadecimal string like the ones returned by the B<winfo id>
124 command. The toplevel widget will be created as a child of the given
125 container instead of the root window for the screen. If the container
126 window is in a Tk application, it must be a frame or toplevel widget for
127 which the B<-container> option was specified.
128 This option may not be changed with the B<configure>
129 method.
130
131 =item Name: B<visual>
132
133 =item Class: B<Visual>
134
135 =item Switch: B<-visual>
136
137 Specifies visual information for the new window in any of the
138 forms accepted by B<Tk_GetVisual>.
139 If this option is not specified, the new window will use the default
140 visual for its screen.
141 The B<visual> option may not be modified with the B<configure>
142 method.
143
144 =item Name: B<width>
145
146 =item Class: B<Width>
147
148 =item Switch: B<-width>
149
150 Specifies the desired width for the window in any of the forms
151 acceptable to B<Tk_GetPixels>.
152 If this option is less than or equal to zero then the window will
153 not request any size at all.
154
155 =back
156
157 =head1 DESCRIPTION
158
159 The B<Toplevel> method creates a new toplevel widget (given
160 by the $widget argument). Additional
161 options, described above, may be specified on the command line
162 or in the option database
163 to configure aspects of the toplevel such as its background color
164 and relief. The B<toplevel> command returns the
165 path name of the new window.
166
167 A toplevel is similar to a frame except that it is created as a
168 top-level window: its X parent is the root window of a screen
169 rather than the logical parent from its path name. The primary
170 purpose of a toplevel is to serve as a container for dialog boxes
171 and other collections of widgets. The only visible features
172 of a toplevel are its background color and an optional 3-D border
173 to make the toplevel appear raised or sunken.
174
175 =head1 WIDGET METHODS
176
177 The B<Toplevel> method creates a widget object.
178 This object supports the B<configure> and B<cget> methods
179 described in L<Tk::options> which can be used to enquire and
180 modify the options described above.
181 The widget also inherits all the methods provided by the generic
182 L<Tk::Widget|Tk::Widget> class, and the L<Tk::Wm|Tk::Wm> class.
183
184 =head1 BINDINGS
185
186 When a new toplevel is created, it has no default event bindings:
187 toplevels are not intended to be interactive.
188
189 =head1 SEE ALSO
190
191 L<Tk::Widget|Tk::Widget>
192 L<Tk::Wm|Tk::Wm>
193
194 =head1 KEYWORDS
195
196 toplevel, widget
197
198 =cut
199