start page | rating of books | rating of authors | reviews | copyrights

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 18.17 The Frame Widget Chapter 18
Perl/Tk
Next: VIII. Win32
 

18.18 The Toplevel Widget

Create a toplevel widget, displayed independently from the main window with the same decoration as the window system, using the Toplevel method.

The standard configuration options that apply to Toplevel are: -background , -bg , -borderwidth , -bw , -cursor , -height , -highlightbackground , -highlightcolor , -highlightthickness , -relief , -takefocus , and -width .

Other options are:

-class => name

The class associated with the toplevel widget.

-colormap => \$window

Specifies another window to share the colormap with. You can point to another window or use the value "new" to specify a new colormap. Default is undef .

-screen => screen

The screen to place the toplevel widget on.

-visual => type n

For the X Window System, changes the depth of colors.

18.18.1 Toplevel Methods

In addition to cget and configure , the following methods are supported by the Toplevel widget. Note that since the MainWindow is a Toplevel widget, each of these methods applies to the MainWindow as well.

aspect

Returns the constraints to the aspect of the window. The four-item list returned corresponds to the minimum width, the minimum height, the maximum width, and the maximum height.

client

Assigns a name to the toplevel window.

colormapwindows

For the X Window System, passes a list of windows to the window manager that have private colormaps. Controls the WM_COLORMAP_WINDOWS property.

command

For the X Window System, returns the command used to start the application.

deiconify

Displays an iconified window.

focusmodel

Gives up the keyboard focus to another window.

frame

Returns the ID of the parent widget as a hexadecimal string.

geometry

For the X Window System, gets the geometry of the toplevel widget.

grid

Changes the size of the toplevel's grid.

group

Makes the widget the group leader of a set of related windows.

iconbitmap

Identifies a bitmap to use as an icon when the window is iconified.

iconify

Iconifies the window.

iconmask

Specifies a mask for the icon bitmap.

iconname

Assigns text to be associated with the icon.

iconposition

Specifies a position for the icon on the desktop.

iconwindow

Specifies a widget to use in place of an icon when iconified.

maxsize

Specifies the largest size for the window.

minsize

Specifies the smallest size for the window.

overrideredirect

Removes window decorations from the window.

positionfrom

Returns either "program" or "user", to tell you whether the user or window manager requested its current position.

protocol

Given one of the window managers WM_DELETE_WINDOW, WM_SAVE_YOURSELF, or WM_TAKE_FOCUS, allows you to define a callback to execute when an associated event is detected.

resizable

Takes boolean values representing whether the window can be resized in width and height, respectively.

sizefrom

Returns either "program" or "user", to tell you whether the user or window manager requested its current size.

state

Returns "normal" , "iconic" , or "withdrawn" , indicating the current state of the window.

title

Changes the title at the top of the window.

transient

Indicates to the window manager that the window is transient.

withdraw

Makes the window non-visible.


Previous: 18.17 The Frame Widget Perl in a Nutshell Next: VIII. Win32
18.17 The Frame Widget Book Index VIII. Win32

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.