.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Wm 3" .TH Wm 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Tk::Wm \- Communicate with window manager .SH SYNOPSIS .IX Header "SYNOPSIS" \ \ \ \ \fR\f(CI$toplevel\fR\fI\fR\->\fImethod\fR(?\fIargs\fR?) .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBwm\fR methods are used to interact with window managers in order to control such things as the title for a window, its geometry, or the increments in terms of which it may be resized. The \fBwm\fR methods can take any of a number of different forms, depending on the particular \fImethod\fR argument. All of the forms expect \fR\f(CI$toplevel\fR\fI\fR, which must be a top-level window object. .PP The legal forms for the \fBwm\fR methods are: .ie n .IP "\fR\fI$toplevel\fR\fI\fR\->\fBaspect\fR(?\fIminNumer minDenom maxNumer maxDenom\fR?)" 4 .el .IP "\fR\f(CI$toplevel\fR\fI\fR\->\fBaspect\fR(?\fIminNumer minDenom maxNumer maxDenom\fR?)" 4 .IX Item "$toplevel->aspect(?minNumer minDenom maxNumer maxDenom?)" If \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR are all specified, then they will be passed to the window manager and the window manager should use them to enforce a range of acceptable aspect ratios for \fR\f(CI$toplevel\fR\fI\fR. The aspect ratio of \&\fI\fR\f(CI$toplevel\fR\fI\fR (width/length) will be constrained to lie between \fIminNumer\fR/\fIminDenom\fR and \fImaxNumer\fR/\fImaxDenom\fR. If \fIminNumer\fR etc. are all specified as empty strings, then any existing aspect ratio restrictions are removed. If \fIminNumer\fR etc. are specified, then the method returns an empty string. Otherwise, it returns a array containing four elements, which are the current values of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR (if no aspect restrictions are in effect, then an empty string is returned). .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBattributes\fR( \fI?args?\fR );" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBattributes\fR( \fI?args?\fR );" 4 .IX Item "$widget->attributes( ?args? );" This subcommand returns or sets platform specific attributes associated with a window. .RS 4 .ie n .IP \fR\fI$widget\fR\fI\fR\->\fBattributes\fR; 4 .el .IP \fR\f(CI$widget\fR\fI\fR\->\fBattributes\fR; 4 .IX Item "$widget->attributes;" Returns a list of the platform specific flags and their values. .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBattributes\fR( \fI?option?\fR );" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBattributes\fR( \fI?option?\fR );" 4 .IX Item "$widget->attributes( ?option? );" Returns the value for the specific option. .ie n .IP "\fR\fI$widget\fR\fI\fR\->\fBattributes\fR( \fI?option value option value...?\fR );" 4 .el .IP "\fR\f(CI$widget\fR\fI\fR\->\fBattributes\fR( \fI?option value option value...?\fR );" 4 .IX Item "$widget->attributes( ?option value option value...? );" Sets one or more of the values. The values are as follows: .Sp On Windows, \fB\-disabled\fR gets or sets whether the window is in a disabled state. \fB\-toolwindow\fR gets or sets the style of the window to toolwindow (as defined in the MSDN). \fB\-topmost\fR gets or sets whether this is a topmost window (displays above all other windows). .Sp On Macintosh, there are currently no special attribute values. .Sp On Unix, there are currently no special attribute values. .RE .RS 4 .RE .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBclient\fR(?\fIname\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBclient\fR(?\fIname\fR?) 4 .IX Item "$toplevel->client(?name?)" If \fIname\fR is specified, this method stores \fIname\fR (which should be the name of the host on which the application is executing) in \fR\f(CI$toplevel\fR\fI\fR's \&\fBWM_CLIENT_MACHINE\fR property for use by the window manager or session manager. The method returns an empty string in this case. If \fIname\fR isn't specified, the method returns the last name set in a \fBclient\fR method for \fI\fR\f(CI$toplevel\fR\fI\fR. If \fIname\fR is specified as an empty string, the method deletes the \&\fBWM_CLIENT_MACHINE\fR property from \fI\fR\f(CI$toplevel\fR\fI\fR. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBcolormapwindows\fR(?\fIwindowList\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBcolormapwindows\fR(?\fIwindowList\fR?) 4 .IX Item "$toplevel->colormapwindows(?windowList?)" This method is used to manipulate the \fBWM_COLORMAP_WINDOWS\fR property, which provides information to the window managers about windows that have private colormaps. If \fIwindowList\fR isn't specified, the method returns a list whose elements are the names of the windows in the \fBWM_COLORMAP_WINDOWS\fR property. If \fIwindowList\fR is specified, it consists of a list of widgets; the method overwrites the \fBWM_COLORMAP_WINDOWS\fR property with the given windows and returns an empty string. The \fBWM_COLORMAP_WINDOWS\fR property should normally contain a list of the internal windows within \fR\f(CI$toplevel\fR\fI\fR whose colormaps differ from their parents. The order of the windows in the property indicates a priority order: the window manager will attempt to install as many colormaps as possible from the head of this list when \fI\fR\f(CI$widget\fR\fI\fR gets the colormap focus. If \fI\fR\f(CI$widget\fR\fI\fR is not included among the windows in \fIwindowList\fR, Tk implicitly adds it at the end of the \fBWM_COLORMAP_WINDOWS\fR property, so that its colormap is lowest in priority. If \fI\fR\f(CI$widget\fR\fI\fR\->colormapwindows is not invoked, Tk will automatically set the property for each top-level window to all the internal windows whose colormaps differ from their parents, followed by the top-level itself; the order of the internal windows is undefined. See the ICCCM documentation for more information on the \&\fBWM_COLORMAP_WINDOWS\fR property. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBcommand\fR(?\fIvalue\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBcommand\fR(?\fIvalue\fR?) 4 .IX Item "$toplevel->command(?value?)" If \fIvalue\fR is specified, this method stores \fIvalue\fR in \fR\f(CI$toplevel\fR\fI\fR's \&\fBWM_COMMAND\fR property for use by the window manager or session manager and returns an empty string. \&\fIValue\fR must have proper list structure; the elements should contain the words of the command used to invoke the application. If \fIvalue\fR isn't specified then the method returns the last value set in a \fBcommand\fR method for \fI\fR\f(CI$toplevel\fR\fI\fR. If \fIvalue\fR is specified as an empty string, the method deletes the \fBWM_COMMAND\fR property from \fI\fR\f(CI$toplevel\fR\fI\fR. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBdeiconify\fR 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBdeiconify\fR 4 .IX Item "$toplevel->deiconify" Arrange for \fR\f(CI$toplevel\fR\fI\fR to be displayed in normal (non-iconified) form. This is done by mapping the window. If the window has never been mapped then this method will not map the window, but it will ensure that when the window is first mapped it will be displayed in de-iconified form. Returns an empty string. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBfocusmodel\fR(?\fBactive\fR|\fBpassive\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBfocusmodel\fR(?\fBactive\fR|\fBpassive\fR?) 4 .IX Item "$toplevel->focusmodel(?active|passive?)" If \fBactive\fR or \fBpassive\fR is supplied as an optional argument to the method, then it specifies the focus model for \fR\f(CI$toplevel\fR\fI\fR. In this case the method returns an empty string. If no additional argument is supplied, then the method returns the current focus model for \fI\fR\f(CI$toplevel\fR\fI\fR. An \fBactive\fR focus model means that \fI\fR\f(CI$toplevel\fR\fI\fR will claim the input focus for itself or its descendants, even at times when the focus is currently in some other application. \fBPassive\fR means that \&\fI\fR\f(CI$toplevel\fR\fI\fR will never claim the focus for itself: the window manager should give the focus to \fI\fR\f(CI$toplevel\fR\fI\fR at appropriate times. However, once the focus has been given to \fI\fR\f(CI$toplevel\fR\fI\fR or one of its descendants, the application may re-assign the focus among \fI\fR\f(CI$toplevel\fR\fI\fR's descendants. The focus model defaults to \fBpassive\fR, and Tk's \fBfocus\fR method assumes a passive model of focusing. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBframe\fR 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBframe\fR 4 .IX Item "$toplevel->frame" If \fR\f(CI$widget\fR\fI\fR has been reparented by the window manager into a decorative frame, the method returns the platform specific window identifier for the outermost frame that contains \fI\fR\f(CI$toplevel\fR\fI\fR (the window whose parent is the root or virtual root). If \fI\fR\f(CI$toplevel\fR\fI\fR hasn't been reparented by the window manager then the method returns the platform specific window identifier for \fI\fR\f(CI$toplevel\fR\fI\fR. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBgeometry\fR(?\fInewGeometry\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBgeometry\fR(?\fInewGeometry\fR?) 4 .IX Item "$toplevel->geometry(?newGeometry?)" If \fInewGeometry\fR is specified, then the geometry of \fR\f(CI$toplevel\fR\fI\fR is changed and an empty string is returned. Otherwise the current geometry for \fI\fR\f(CI$toplevel\fR\fI\fR is returned (this is the most recent geometry specified either by manual resizing or in a \fBgeometry\fR method). \fINewGeometry\fR has the form \fB=\fR\fIwidth\fR\fBx\fR\fIheight\fR\fB+\-\fR\fIx\fR\fB+\-\fR\fIy\fR, where any of \fB=\fR, \fIwidth\fR\fBx\fR\fIheight\fR, or \fB+\-\fR\fIx\fR\fB+\-\fR\fIy\fR may be omitted. \fIWidth\fR and \fIheight\fR are positive integers specifying the desired dimensions of \fI\fR\f(CI$toplevel\fR\fI\fR. If \fI\fR\f(CI$toplevel\fR\fI\fR is gridded (see "GRIDDED GEOMETRY MANAGEMENT" below) then the dimensions are specified in grid units; otherwise they are specified in pixel units. \fIX\fR and \fIy\fR specify the desired location of \&\fI\fR\f(CI$toplevel\fR\fI\fR on the screen, in pixels. If \fIx\fR is preceded by \fB+\fR, it specifies the number of pixels between the left edge of the screen and the left edge of \fI\fR\f(CI$toplevel\fR\fI\fR's border; if preceded by \fB\-\fR then \&\fIx\fR specifies the number of pixels between the right edge of the screen and the right edge of \fI\fR\f(CI$toplevel\fR\fI\fR's border. If \fIy\fR is preceded by \fB+\fR then it specifies the number of pixels between the top of the screen and the top of \fI\fR\f(CI$toplevel\fR\fI\fR's border; if \fIy\fR is preceded by \fB\-\fR then it specifies the number of pixels between the bottom of \fI\fR\f(CI$toplevel\fR\fI\fR's border and the bottom of the screen. If \fInewGeometry\fR is specified as an empty string then any existing user-specified geometry for \fI\fR\f(CI$toplevel\fR\fI\fR is cancelled, and the window will revert to the size requested internally by its widgets. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBwmGrid\fR(?\fIbaseWidth,baseHeight,widthInc,heightInc\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBwmGrid\fR(?\fIbaseWidth,baseHeight,widthInc,heightInc\fR?) 4 .IX Item "$toplevel->wmGrid(?baseWidth,baseHeight,widthInc,heightInc?)" This method indicates that \fR\f(CI$toplevel\fR\fI\fR is to be managed as a gridded window. It also specifies the relationship between grid units and pixel units. \&\fIBaseWidth\fR and \fIbaseHeight\fR specify the number of grid units corresponding to the pixel dimensions requested internally by \fI\fR\f(CI$toplevel\fR\fI\fR using \fBTk_GeometryRequest\fR. \fIWidthInc\fR and \fIheightInc\fR specify the number of pixels in each horizontal and vertical grid unit. These four values determine a range of acceptable sizes for \&\fI\fR\f(CI$toplevel\fR\fI\fR, corresponding to grid-based widths and heights that are non-negative integers. Tk will pass this information to the window manager; during manual resizing, the window manager will restrict the window's size to one of these acceptable sizes. Furthermore, during manual resizing the window manager will display the window's current size in terms of grid units rather than pixels. If \fIbaseWidth\fR etc. are all specified as empty strings, then \&\fI\fR\f(CI$toplevel\fR\fI\fR will no longer be managed as a gridded window. If \&\fIbaseWidth\fR etc. are specified then the return value is an empty string. Otherwise the return value is a array containing four elements corresponding to the current \fIbaseWidth\fR, \&\fIbaseHeight\fR, \fIwidthInc\fR, and \fIheightInc\fR; if \&\fI\fR\f(CI$toplevel\fR\fI\fR is not currently gridded, then an empty string is returned. Note: this command should not be needed very often, since the \&\fBTk_SetGrid\fR library procedure and the \fB\-setgrid\fR option provide easier access to the same functionality. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBgroup\fR(?\fI\fR\fI$widget\fR\fI\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBgroup\fR(?\fI\fR\f(CI$widget\fR\fI\fR?) 4 .IX Item "$toplevel->group(?$widget?)" If \fR\f(CI$widget\fR\fI\fR is specified, it is the the leader of a group of related windows. The window manager may use this information, for example, to unmap all of the windows in a group when the group's leader is iconified. \fI\fR\f(CI$widget\fR\fI\fR may be specified as an empty string to remove \fI\fR\f(CI$toplevel\fR\fI\fR from any group association. If \fI\fR\f(CI$widget\fR\fI\fR is specified then the method returns an empty string; otherwise it returns the \fI\fR\f(CI$toplevel\fR\fI\fR's current group leader, or an empty string if \fI\fR\f(CI$toplevel\fR\fI\fR isn't part of any group. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBiconbitmap\fR(?\fIbitmap\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBiconbitmap\fR(?\fIbitmap\fR?) 4 .IX Item "$toplevel->iconbitmap(?bitmap?)" If \fIbitmap\fR is specified, then it names a bitmap in the standard forms accepted by Tk (see the \fBTk_GetBitmap\fR documentation for details). This \fIblack and white\fR bitmap is passed to the window manager to be displayed in \fR\f(CI$toplevel\fR\fI\fR's icon, and the method returns an empty string. If an empty string is specified for \fIbitmap\fR, then any current icon bitmap or image is cancelled for \fI\fR\f(CI$toplevel\fR\fI\fR. If \fIbitmap\fR is specified then the method returns an empty string. Otherwise it returns the name of the current icon bitmap associated with \fI\fR\f(CI$toplevel\fR\fI\fR, or an empty string if \fI\fR\f(CI$toplevel\fR\fI\fR has no icon bitmap. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBiconify\fR 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBiconify\fR 4 .IX Item "$toplevel->iconify" Arrange for \fR\f(CI$toplevel\fR\fI\fR to be iconified. It \fI\fR\f(CI$toplevel\fR\fI\fR hasn't yet been mapped for the first time, this method will arrange for it to appear in the iconified state when it is eventually mapped. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBiconimage\fR(?\fIimage\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBiconimage\fR(?\fIimage\fR?) 4 .IX Item "$toplevel->iconimage(?image?)" If \fIimage\fR is specified, then it names a normal Tk image. This image is rendered into a private \fIcoloured\fR bitmap which is passed to the window manager to be displayed in \fR\f(CI$toplevel\fR\fI\fR's icon, and the method returns an empty string. If an empty string is specified for \fIimage\fR, then any current icon bitmap or image is cancelled for \fI\fR\f(CI$toplevel\fR\fI\fR. If \fIimage\fR is specified then the method returns an empty string. Otherwise it returns the name of the current icon image associated with \fI\fR\f(CI$toplevel\fR\fI\fR, or an empty string if \fI\fR\f(CI$toplevel\fR\fI\fR has no icon image. The private pixmap is not pre-cleared so images which are partly "transparent" display rubbish in their transparent parts. .Sp The sizes of images that can be used as icons in this manner are platform dependant. On Win32 this sets the "large" icon, which should be 32x32, it will automatically be scaled down to 16x16 for use as a small icon. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBiconmask\fR(?\fIbitmap\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBiconmask\fR(?\fIbitmap\fR?) 4 .IX Item "$toplevel->iconmask(?bitmap?)" If \fIbitmap\fR is specified, then it names a bitmap in the standard forms accepted by Tk (see the \fBTk_GetBitmap\fR documentation for details). This bitmap is passed to the window manager to be used as a mask in conjunction with the \fBiconbitmap\fR option: where the mask has zeroes no icon will be displayed; where it has ones, the bits from the icon bitmap will be displayed. If an empty string is specified for \fIbitmap\fR then any current icon mask is cancelled for \fR\f(CI$toplevel\fR\fI\fR (this is equivalent to specifying a bitmap of all ones). If \fIbitmap\fR is specified then the method returns an empty string. Otherwise it returns the name of the current icon mask associated with \&\fI\fR\f(CI$toplevel\fR\fI\fR, or an empty string if no mask is in effect. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBiconname\fR(?\fInewName\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBiconname\fR(?\fInewName\fR?) 4 .IX Item "$toplevel->iconname(?newName?)" If \fInewName\fR is specified, then it is passed to the window manager; the window manager should display \fInewName\fR inside the icon associated with \fR\f(CI$toplevel\fR\fI\fR. In this case an empty string is returned as result. If \fInewName\fR isn't specified then the method returns the current icon name for \fI\fR\f(CI$toplevel\fR\fI\fR, or an empty string if no icon name has been specified (in this case the window manager will normally display the window's title, as specified with the \fBtitle\fR method). .ie n .IP "\fR\fI$toplevel\fR\fI\fR\->\fBiconphoto\fR(?\-default? \fIimage1\fR ?\fIimage2\fR ...?)" 4 .el .IP "\fR\f(CI$toplevel\fR\fI\fR\->\fBiconphoto\fR(?\-default? \fIimage1\fR ?\fIimage2\fR ...?)" 4 .IX Item "$toplevel->iconphoto(?-default? image1 ?image2 ...?)" Sets the titlebar icon for window based on the named photo images. If \-default is specified, this is applied to all future created toplevels as well. The data in the images is taken as a snapshot at the time of invocation. If the images are later changed, this is not reflected to the titlebar icons. Multiple images are accepted to allow different images sizes (eg, 16x16 and 32x32) to be provided. The window manager may scale pro\- vided icons to an appropriate size. .Sp On Windows, the images are packed into a Windows icon structure. This will override an ico specified to wm iconbitmap, and vice versa. [NOTE: This is not implemented yet!] .Sp On X, the images are arranged into the _NET_WM_ICON X property, which most modern window managers support. A wm iconbitmap may exist simultaneously. It is recommended to use not more than 2 icons, placing the larger icon first. .Sp On Macintosh, this is currently does nothing. .ie n .IP "\fR\fI$toplevel\fR\fI\fR\->\fBiconposition\fR(?\fIx y\fR?)" 4 .el .IP "\fR\f(CI$toplevel\fR\fI\fR\->\fBiconposition\fR(?\fIx y\fR?)" 4 .IX Item "$toplevel->iconposition(?x y?)" If \fIx\fR and \fIy\fR are specified, they are passed to the window manager as a hint about where to position the icon for \fR\f(CI$toplevel\fR\fI\fR. In this case an empty string is returned. If \fIx\fR and \fIy\fR are specified as empty strings then any existing icon position hint is cancelled. If neither \fIx\fR nor \fIy\fR is specified, then the method returns a array containing two values, which are the current icon position hints (if no hints are in effect then an empty string is returned). .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBiconwindow\fR(?\fI\fR\fI$widget\fR\fI\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBiconwindow\fR(?\fI\fR\f(CI$widget\fR\fI\fR?) 4 .IX Item "$toplevel->iconwindow(?$widget?)" If \fR\f(CI$widget\fR\fI\fR is specified, it is a window to use as icon for \fI\fR\f(CI$toplevel\fR\fI\fR: when \fI\fR\f(CI$toplevel\fR\fI\fR is iconified then \&\fI\fR\f(CI$widget\fR\fI\fR will be mapped to serve as icon, and when \fI\fR\f(CI$toplevel\fR\fI\fR is de-iconified then \fI\fR\f(CI$widget\fR\fI\fR will be unmapped again. If \&\fI\fR\f(CI$widget\fR\fI\fR is specified as an empty string then any existing icon window association for \fI\fR\f(CI$toplevel\fR\fI\fR will be cancelled. If the \fI\fR\f(CI$widget\fR\fI\fR argument is specified then an empty string is returned. Otherwise the method returns the current icon window for \fI\fR\f(CI$toplevel\fR\fI\fR, or an empty string if there is no icon window currently specified for \fI\fR\f(CI$toplevel\fR\fI\fR. Button press events are disabled for \fI\fR\f(CI$toplevel\fR\fI\fR as long as it is an icon window; this is needed in order to allow window managers to ``own'' those events. Note: not all window managers support the notion of an icon window. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBmaxsize\fR(?\fIwidth,height\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBmaxsize\fR(?\fIwidth,height\fR?) 4 .IX Item "$toplevel->maxsize(?width,height?)" If \fIwidth\fR and \fIheight\fR are specified, they give the maximum permissible dimensions for \fR\f(CI$toplevel\fR\fI\fR. For gridded windows the dimensions are specified in grid units; otherwise they are specified in pixel units. The window manager will restrict the window's dimensions to be less than or equal to \fIwidth\fR and \fIheight\fR. If \fIwidth\fR and \fIheight\fR are specified, then the method returns an empty string. Otherwise it returns a array with two elements, which are the maximum width and height currently in effect. The maximum size defaults to the size of the screen. If resizing has been disabled with the \fBresizable\fR method, then this method has no effect. See the sections on geometry management below for more information. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBminsize\fR(?\fIwidth,height\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBminsize\fR(?\fIwidth,height\fR?) 4 .IX Item "$toplevel->minsize(?width,height?)" If \fIwidth\fR and \fIheight\fR are specified, they give the minimum permissible dimensions for \fR\f(CI$toplevel\fR\fI\fR. For gridded windows the dimensions are specified in grid units; otherwise they are specified in pixel units. The window manager will restrict the window's dimensions to be greater than or equal to \fIwidth\fR and \fIheight\fR. If \fIwidth\fR and \fIheight\fR are specified, then the method returns an empty string. Otherwise it returns a array with two elements, which are the minimum width and height currently in effect. The minimum size defaults to one pixel in each dimension. If resizing has been disabled with the \fBresizable\fR method, then this method has no effect. See the sections on geometry management below for more information. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBoverrideredirect(?\fR\fIboolean\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBoverrideredirect(?\fR\fIboolean\fR?) 4 .IX Item "$toplevel->overrideredirect(?boolean?)" If \fIboolean\fR is specified, it must have a proper boolean form and the override-redirect flag for \fR\f(CI$toplevel\fR\fI\fR is set to that value. If \fIboolean\fR is not specified then \fB1\fR or \fB0\fR is returned to indicate whether or not the override-redirect flag is currently set for \fI\fR\f(CI$toplevel\fR\fI\fR. Setting the override-redirect flag for a window causes it to be ignored by the window manager; among other things, this means that the window will not be reparented from the root window into a decorative frame and the user will not be able to manipulate the window using the normal window manager mechanisms. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBpositionfrom\fR(?\fIwho\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBpositionfrom\fR(?\fIwho\fR?) 4 .IX Item "$toplevel->positionfrom(?who?)" If \fIwho\fR is specified, it must be either \fBprogram\fR or \&\fBuser\fR, or an abbreviation of one of these two. It indicates whether \fR\f(CI$toplevel\fR\fI\fR's current position was requested by the program or by the user. Many window managers ignore program-requested initial positions and ask the user to manually position the window; if \&\fBuser\fR is specified then the window manager should position the window at the given place without asking the user for assistance. If \fIwho\fR is specified as an empty string, then the current position source is cancelled. If \fIwho\fR is specified, then the method returns an empty string. Otherwise it returns \fBuser\fR or \f(CW$widget\fR to indicate the source of the window's current position, or an empty string if no source has been specified yet. Most window managers interpret ``no source'' as equivalent to \fBprogram\fR. Tk will automatically set the position source to \fBuser\fR when a \fBgeometry\fR method is invoked, unless the source has been set explicitly to \fBprogram\fR. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBprotocol\fR(?\fIname\fR?,?\fIcallback\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBprotocol\fR(?\fIname\fR?,?\fIcallback\fR?) 4 .IX Item "$toplevel->protocol(?name?,?callback?)" This method is used to manage window manager protocols such as \&\fBWM_DELETE_WINDOW\fR. \&\fIName\fR is the name of an atom corresponding to a window manager protocol, such as \fBWM_DELETE_WINDOW\fR or \fBWM_SAVE_YOURSELF\fR or \fBWM_TAKE_FOCUS\fR. If both \fIname\fR and \fIcallback\fR are specified, then \fIcallback\fR is associated with the protocol specified by \fIname\fR. \&\fIName\fR will be added to \fR\f(CI$toplevel\fR\fI\fR's \fBWM_PROTOCOLS\fR property to tell the window manager that the application has a protocol handler for \fIname\fR, and \fIcallback\fR will be invoked in the future whenever the window manager sends a message to the client for that protocol. In this case the method returns an empty string. If \fIname\fR is specified but \fIcallback\fR isn't, then the current callback for \fIname\fR is returned, or an empty string if there is no handler defined for \fIname\fR. If \fIcallback\fR is specified as an empty string then the current handler for \fIname\fR is deleted and it is removed from the \&\fBWM_PROTOCOLS\fR property on \fI\fR\f(CI$toplevel\fR\fI\fR; an empty string is returned. Lastly, if neither \fIname\fR nor \fIcallback\fR is specified, the method returns a list of all the protocols for which handlers are currently defined for \fI\fR\f(CI$toplevel\fR\fI\fR. .RS 4 .Sp .RS 8 Tk always defines a protocol handler for \fBWM_DELETE_WINDOW\fR, even if you haven't asked for one with \fBprotocol\fR. If a \fBWM_DELETE_WINDOW\fR message arrives when you haven't defined a handler, then Tk handles the message by destroying the window for which it was received. .RE .RE .RS 4 .RE .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBresizable\fR(?\fIwidth,height\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBresizable\fR(?\fIwidth,height\fR?) 4 .IX Item "$toplevel->resizable(?width,height?)" This method controls whether or not the user may interactively resize a top-level window. If \fIwidth\fR and \fIheight\fR are specified, they are boolean values that determine whether the width and height of \fR\f(CI$toplevel\fR\fI\fR may be modified by the user. In this case the method returns an empty string. If \fIwidth\fR and \fIheight\fR are omitted then the method returns a list with two 0/1 elements that indicate whether the width and height of \fI\fR\f(CI$toplevel\fR\fI\fR are currently resizable. By default, windows are resizable in both dimensions. If resizing is disabled, then the window's size will be the size from the most recent interactive resize or \fBgeometry\fR method. If there has been no such operation then the window's natural size will be used. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBsizefrom\fR(?\fIwho\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBsizefrom\fR(?\fIwho\fR?) 4 .IX Item "$toplevel->sizefrom(?who?)" If \fIwho\fR is specified, it must be either \fBprogram\fR or \&\fBuser\fR, or an abbreviation of one of these two. It indicates whether \fR\f(CI$toplevel\fR\fI\fR's current size was requested by the program or by the user. Some window managers ignore program-requested sizes and ask the user to manually size the window; if \&\fBuser\fR is specified then the window manager should give the window its specified size without asking the user for assistance. If \fIwho\fR is specified as an empty string, then the current size source is cancelled. If \fIwho\fR is specified, then the method returns an empty string. Otherwise it returns \fBuser\fR or \f(CW$widget\fR to indicate the source of the window's current size, or an empty string if no source has been specified yet. Most window managers interpret ``no source'' as equivalent to \fBprogram\fR. .ie n .IP "\fR\fI$toplevel\fR\fI\fR\->\fBstackorder\fR( \fI?isabove|isbelow \fR\fI$toplevel\fR\fI?\fR );" 4 .el .IP "\fR\f(CI$toplevel\fR\fI\fR\->\fBstackorder\fR( \fI?isabove|isbelow \fR\f(CI$toplevel\fR\fI?\fR );" 4 .IX Item "$toplevel->stackorder( ?isabove|isbelow $toplevel? );" The stackorder command returns a list of toplevel windows in stacking order, from lowest to highest. When a single toplevel window is passed, the returned list recursively includes all of the window's children that are toplevels. Only those toplevels that are currently mapped to the screen are returned. The stackorder command can also be used to determine if one toplevel is positioned above or below a second toplevel. When two window arguments separated by either isabove or isbelow are passed, a boolean result indicates whether or not the first window is currently above or below the second window in the stacking order. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBstate\fR(?\fInewstate\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBstate\fR(?\fInewstate\fR?) 4 .IX Item "$toplevel->state(?newstate?)" If \fInewstate\fR is specified, the window will be set to the new state, otherwise it returns the current state of \&\fR\f(CI$toplevel\fR\fI\fR: either \fBnormal\fR, \fBiconic\fR, \fBwithdrawn\fR, \fBicon\fR, or (Windows only) \fBzoomed\fR. The difference between \fBiconic\fR and \fBicon\fR is that \fBiconic\fR refers to a window that has been iconified (e.g., with the \fBiconify\fR method) while \fBicon\fR refers to a window whose only purpose is to serve as the icon for some other window (via the \fBiconwindow\fR method). The \&\fBicon\fR state cannot be set. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBtitle\fR(?\fIstring\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBtitle\fR(?\fIstring\fR?) 4 .IX Item "$toplevel->title(?string?)" If \fIstring\fR is specified, then it will be passed to the window manager for use as the title for \fR\f(CI$toplevel\fR\fI\fR (the window manager should display this string in \fI\fR\f(CI$toplevel\fR\fI\fR's title bar). In this case the method returns an empty string. If \fIstring\fR isn't specified then the method returns the current title for the \&\fI\fR\f(CI$toplevel\fR\fI\fR. The title for a window defaults to its name. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBtransient\fR(?\fImaster\fR?) 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBtransient\fR(?\fImaster\fR?) 4 .IX Item "$toplevel->transient(?master?)" If \fImaster\fR is specified, then the window manager is informed that \fR\f(CI$toplevel\fR\fI\fR is a transient window (e.g. pull-down menu) working on behalf of \fImaster\fR (where \fImaster\fR is a top-level window). Some window managers will use this information to manage \fI\fR\f(CI$toplevel\fR\fI\fR specially. If \fImaster\fR is specified as an empty string then \fI\fR\f(CI$toplevel\fR\fI\fR is marked as not being a transient window any more. If \fImaster\fR is specified, then the method returns an empty string. Otherwise the method returns the path name of \fI\fR\f(CI$toplevel\fR\fI\fR's current master, or an empty string if \fI\fR\f(CI$toplevel\fR\fI\fR isn't currently a transient window. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBwithdraw\fR 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBwithdraw\fR 4 .IX Item "$toplevel->withdraw" Arranges for \fR\f(CI$toplevel\fR\fI\fR to be withdrawn from the screen. This causes the window to be unmapped and forgotten about by the window manager. If the window has never been mapped, then this method causes the window to be mapped in the withdrawn state. Not all window managers appear to know how to handle windows that are mapped in the withdrawn state. Note: it sometimes seems to be necessary to withdraw a window and then re-map it (e.g. with \fBdeiconify\fR) to get some window managers to pay attention to changes in window attributes such as group. .ie n .IP \fR\fI$toplevel\fR\fI\fR\->\fBwrapper\fR 4 .el .IP \fR\f(CI$toplevel\fR\fI\fR\->\fBwrapper\fR 4 .IX Item "$toplevel->wrapper" Returns a list of two elements: the window id of the wrapper window in which Tk has placed \fR\f(CI$toplevel\fR\fI\fR, and the height of the menu bar. The id is the one by which window manager will know \fI\fR\f(CI$toplevel\fR\fI\fR, and so is appropriate place to add X properties. The menu height is only returned on X. On Windows, this value is always zero. .SH "ICON SIZES" .IX Header "ICON SIZES" The sizes of bitmaps/images that can be used as icons in this manner are platform and window manager dependant. Unix window managers are typically more tolerant than Win32. It is possible that coloured \f(CW\*(C`iconimage\*(C'\fR icons may cause problems on some X window managers. .IP \(bu 4 Win32 .Sp \&\f(CW\*(C`iconimage\*(C'\fR and \f(CW\*(C`iconbitmap\*(C'\fR set the "large" icon, which should be 32x32, it will automatically be scaled down to 16x16 for use as a small icon. Win32 ignores \f(CW\*(C`iconwin\*(C'\fR requests. .IP \(bu 4 KDE's "kwm" .Sp Accepts coloured \f(CW\*(C`iconimage\*(C'\fR and black and white \f(CW\*(C`iconbitmap\*(C'\fR but will scale either to a small (14x14?) icon. Kwm ignores \f(CW\*(C`iconwin\*(C'\fR. .IP \(bu 4 Sun's "olwm" or "olvwm" .Sp Honours \f(CW\*(C`iconwin\*(C'\fR which will override \f(CW\*(C`iconimage\*(C'\fR or \f(CW\*(C`iconbitmap\*(C'\fR. Coloured images work. .IP \(bu 4 Sun's CDE window manager .Sp Coloured images work. ... .SH "GEOMETRY MANAGEMENT" .IX Header "GEOMETRY MANAGEMENT" By default a top-level window appears on the screen in its \&\fInatural size\fR, which is the one determined internally by its widgets and geometry managers. If the natural size of a top-level window changes, then the window's size changes to match. A top-level window can be given a size other than its natural size in two ways. First, the user can resize the window manually using the facilities of the window manager, such as resize handles. Second, the application can request a particular size for a top-level window using the \fBgeometry\fR method. These two cases are handled identically by Tk; in either case, the requested size overrides the natural size. You can return the window to its natural by invoking \fBgeometry\fR with an empty \fIgeometry\fR string. .PP Normally a top-level window can have any size from one pixel in each dimension up to the size of its screen. However, you can use the \fBminsize\fR and \fBmaxsize\fR methods to limit the range of allowable sizes. The range set by \fBminsize\fR and \fBmaxsize\fR applies to all forms of resizing, including the window's natural size as well as manual resizes and the \fBgeometry\fR method. You can also use the method \fBresizable\fR to completely disable interactive resizing in one or both dimensions. .SH "GRIDDED GEOMETRY MANAGEMENT" .IX Header "GRIDDED GEOMETRY MANAGEMENT" Gridded geometry management occurs when one of the widgets of an application supports a range of useful sizes. This occurs, for example, in a text editor where the scrollbars, menus, and other adornments are fixed in size but the edit widget can support any number of lines of text or characters per line. In this case, it is usually desirable to let the user specify the number of lines or characters-per-line, either with the \&\fBgeometry\fR method or by interactively resizing the window. In the case of text, and in other interesting cases also, only discrete sizes of the window make sense, such as integral numbers of lines and characters-per-line; arbitrary pixel sizes are not useful. .PP Gridded geometry management provides support for this kind of application. Tk (and the window manager) assume that there is a grid of some sort within the application and that the application should be resized in terms of \fIgrid units\fR rather than pixels. Gridded geometry management is typically invoked by turning on the \fBsetGrid\fR option for a widget; it can also be invoked with the \fBwmGrid\fR method or by calling \fBTk_SetGrid\fR. In each of these approaches the particular widget (or sometimes code in the application as a whole) specifies the relationship between integral grid sizes for the window and pixel sizes. To return to non-gridded geometry management, invoke \&\fBgrid\fR with empty argument strings. .PP When gridded geometry management is enabled then all the dimensions specified in \fBminsize\fR, \fBmaxsize\fR, and \fBgeometry\fR methods are treated as grid units rather than pixel units. Interactive resizing is also carried out in even numbers of grid units rather than pixels. .SH BUGS .IX Header "BUGS" Most existing window managers appear to have bugs that affect the operation of the \fBwm\fR methods. For example, some changes won't take effect if the window is already active: the window will have to be withdrawn and de-iconified in order to make the change happen. .SH "SEE ALSO" .IX Header "SEE ALSO" Tk::Widget Tk::tixWm Tk::Mwm .SH KEYWORDS .IX Header "KEYWORDS" aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager