| 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 Name: B<use> |
| 112 | |
| 113 | =item Class: B<Use> |
| 114 | |
| 115 | =item Switch: B<-use> |
| 116 | |
| 117 | This option is used for embedding. If the value isn't an empty string, |
| 118 | it must be the the window identifier of a container window, specified as |
| 119 | a hexadecimal string like the ones returned by the B<winfo id> |
| 120 | command. The toplevel widget will be created as a child of the given |
| 121 | container instead of the root window for the screen. If the container |
| 122 | window is in a Tk application, it must be a frame or toplevel widget for |
| 123 | which the B<-container> option was specified. |
| 124 | This option may not be changed with the B<configure> |
| 125 | method. |
| 126 | |
| 127 | =item Name: B<visual> |
| 128 | |
| 129 | =item Class: B<Visual> |
| 130 | |
| 131 | =item Switch: B<-visual> |
| 132 | |
| 133 | Specifies visual information for the new window in any of the |
| 134 | forms accepted by B<Tk_GetVisual>. |
| 135 | If this option is not specified, the new window will use the default |
| 136 | visual for its screen. |
| 137 | The B<visual> option may not be modified with the B<configure> |
| 138 | method. |
| 139 | |
| 140 | =item Name: B<width> |
| 141 | |
| 142 | =item Class: B<Width> |
| 143 | |
| 144 | =item Switch: B<-width> |
| 145 | |
| 146 | Specifies the desired width for the window in any of the forms |
| 147 | acceptable to B<Tk_GetPixels>. |
| 148 | If this option is less than or equal to zero then the window will |
| 149 | not request any size at all. |
| 150 | |
| 151 | =back |
| 152 | |
| 153 | =head1 DESCRIPTION |
| 154 | |
| 155 | The B<Toplevel> method creates a new toplevel widget (given |
| 156 | by the $widget argument). Additional |
| 157 | options, described above, may be specified on the command line |
| 158 | or in the option database |
| 159 | to configure aspects of the toplevel such as its background color |
| 160 | and relief. The B<toplevel> command returns the |
| 161 | path name of the new window. |
| 162 | |
| 163 | A toplevel is similar to a frame except that it is created as a |
| 164 | top-level window: its X parent is the root window of a screen |
| 165 | rather than the logical parent from its path name. The primary |
| 166 | purpose of a toplevel is to serve as a container for dialog boxes |
| 167 | and other collections of widgets. The only visible features |
| 168 | of a toplevel are its background color and an optional 3-D border |
| 169 | to make the toplevel appear raised or sunken. |
| 170 | |
| 171 | =head1 WIDGET METHODS |
| 172 | |
| 173 | The B<Toplevel> method creates a widget object. |
| 174 | This object supports the B<configure> and B<cget> methods |
| 175 | described in L<Tk::options> which can be used to enquire and |
| 176 | modify the options described above. |
| 177 | The widget also inherits all the methods provided by the generic |
| 178 | L<Tk::Widget|Tk::Widget> class, and the L<Tk::Wm|Tk::Wm> class. |
| 179 | |
| 180 | =head1 BINDINGS |
| 181 | |
| 182 | When a new toplevel is created, it has no default event bindings: |
| 183 | toplevels are not intended to be interactive. |
| 184 | |
| 185 | =head1 SEE ALSO |
| 186 | |
| 187 | L<Tk::Widget|Tk::Widget> |
| 188 | L<Tk::Wm|Tk::Wm> |
| 189 | |
| 190 | =head1 KEYWORDS |
| 191 | |
| 192 | toplevel, widget |
| 193 | |
| 194 | =cut |
| 195 | |