1#  Copyright (c) 1991-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
10Tk::Wm - Communicate with window manager
11
12=for category Tk Geometry Management
13
14=head1 SYNOPSIS
15
16S<    >I<$toplevel>-E<gt>I<method>(?I<args>?)
17
18=head1 DESCRIPTION
19
20The B<wm> methods are used to interact with window managers in
21order to control such things as the title for a window, its geometry,
22or the increments in terms of which it may be resized.
23The B<wm> methods can take any of a number of different forms, depending on
24the particular I<method> argument.
25All of the forms expect I<$toplevel>, which must be a
26top-level window object.
27
28The legal forms for the B<wm> methods are:
29
30=over 4
31
32=item I<$toplevel>-E<gt>B<aspect>(?I<minNumer minDenom maxNumer maxDenom>?)
33
34If I<minNumer>, I<minDenom>, I<maxNumer>, and I<maxDenom>
35are all specified, then they will be passed to the window manager
36and the window manager should use them to enforce a range of
37acceptable aspect ratios for I<$toplevel>.  The aspect ratio of
38I<$toplevel> (width/length) will be constrained to lie
39between I<minNumer>/I<minDenom> and I<maxNumer>/I<maxDenom>.
40If I<minNumer> etc. are all specified as empty strings, then
41any existing aspect ratio restrictions are removed.
42If I<minNumer> etc. are specified, then the method returns an
43empty string.  Otherwise, it returns
44a array containing four elements, which are the current values
45of I<minNumer>, I<minDenom>, I<maxNumer>, and I<maxDenom>
46(if no aspect restrictions are in effect, then an empty string is
47returned).
48
49=item I<$widget>-E<gt>B<attributes>( I<?args?> );
50
51This subcommand returns or  sets  platform  specific  attributes
52associated with a window.
53
54=over 4
55
56=item I<$widget>-E<gt>B<attributes>;
57
58Returns a list of the  platform specific  flags  and  their  values.
59
60=item I<$widget>-E<gt>B<attributes>( I<?option?> );
61
62Returns  the  value for the specific option.
63
64=item I<$widget>-E<gt>B<attributes>( I<?option value option value...?> );
65
66Sets one or more of the values. The values are as follows:
67
68On Windows, B<-disabled> gets or sets whether the window is in  a
69disabled state. B<-toolwindow> gets or sets the style of the window
70to toolwindow (as defined in the MSDN). B<-topmost> gets or sets
71whether this is a topmost window (displays above all other windows).
72
73On Macintosh, there are currently no special attribute values.
74
75On Unix, there are currently no special attribute values.
76
77=back
78
79=item I<$toplevel>-E<gt>B<client>(?I<name>?)
80
81If I<name> is specified, this method stores I<name> (which
82should be the name of
83the host on which the application is executing) in I<$toplevel>'s
84B<WM_CLIENT_MACHINE> property for use by the window manager or
85session manager.
86The method returns an empty string in this case.
87If I<name> isn't specified, the method returns the last name
88set in a B<client> method for I<$toplevel>.
89If I<name> is specified as an empty string, the method deletes the
90B<WM_CLIENT_MACHINE> property from I<$toplevel>.
91
92=item I<$toplevel>-E<gt>B<colormapwindows>(?I<windowList>?)
93
94This method is used to manipulate the B<WM_COLORMAP_WINDOWS>
95property, which provides information to the window managers about
96windows that have private colormaps.
97If I<windowList> isn't specified, the method returns a list
98whose elements are the names of the windows in the B<WM_COLORMAP_WINDOWS>
99property.
100If I<windowList> is specified, it consists of a list of widgets;
101the method overwrites the B<WM_COLORMAP_WINDOWS>
102property with the given windows and returns an empty string.
103The B<WM_COLORMAP_WINDOWS> property should normally contain a
104list of the internal windows within I<$toplevel> whose colormaps differ
105from their parents.
106The order of the windows in the property indicates a priority order:
107the window manager will attempt to install as many colormaps as possible
108from the head of this list when I<$widget> gets the colormap focus.
109If I<$widget> is not included among the windows in I<windowList>,
110Tk implicitly adds it at the end of the B<WM_COLORMAP_WINDOWS>
111property, so that its colormap is lowest in priority.
112If I<$widget>-E<gt>colormapwindows is not invoked, Tk will automatically set
113the property for each top-level window to all the internal windows
114whose colormaps differ from their parents, followed by the top-level
115itself;  the order of the internal windows is undefined.
116See the ICCCM documentation for more information on the
117B<WM_COLORMAP_WINDOWS> property.
118
119=item I<$toplevel>-E<gt>B<command>(?I<value>?)
120
121If I<value> is specified, this method stores I<value> in I<$toplevel>'s
122B<WM_COMMAND> property for use by the window manager or
123session manager and returns an empty string.
124I<Value> must have proper list structure;  the elements should
125contain the words of the command used to invoke the application.
126If I<value> isn't specified then the method returns the last value
127set in a B<command> method for I<$toplevel>.
128If I<value> is specified as an empty string, the method
129deletes the B<WM_COMMAND> property from I<$toplevel>.
130
131=item I<$toplevel>-E<gt>B<deiconify>
132
133Arrange for I<$toplevel> to be displayed in normal (non-iconified) form.
134This is done by mapping the window.  If the window has never been
135mapped then this method will not map the window, but it will ensure
136that when the window is first mapped it will be displayed
137in de-iconified form.  Returns an empty string.
138
139=item I<$toplevel>-E<gt>B<focusmodel>(?B<active>|B<passive>?)
140
141If B<active> or B<passive> is supplied as an optional argument
142to the method, then it specifies the focus model for I<$toplevel>.
143In this case the method returns an empty string.  If no additional
144argument is supplied, then the method returns the current focus
145model for I<$toplevel>.
146An B<active> focus model means that I<$toplevel> will claim the
147input focus for itself or its descendants, even at times when
148the focus is currently in some other application.  B<Passive> means that
149I<$toplevel> will never claim the focus for itself:  the window manager
150should give the focus to I<$toplevel> at appropriate times.  However,
151once the focus has been given to I<$toplevel> or one of its descendants,
152the application may re-assign the focus among I<$toplevel>'s descendants.
153The focus model defaults to B<passive>, and Tk's B<focus> method
154assumes a passive model of focusing.
155
156=item I<$toplevel>-E<gt>B<frame>
157
158If I<$widget> has been reparented by the window manager into a
159decorative frame, the method returns the platform specific window
160identifier for the outermost frame that contains I<$toplevel> (the
161window whose parent is the root or virtual root).  If I<$toplevel>
162hasn't been reparented by the window manager then the method returns
163the platform specific window identifier for I<$toplevel>.
164
165=item I<$toplevel>-E<gt>B<geometry>(?I<newGeometry>?)
166
167If I<newGeometry> is specified, then the geometry of I<$toplevel>
168is changed and an empty string is returned.  Otherwise the current
169geometry for I<$toplevel> is returned (this is the most recent
170geometry specified either by manual resizing or
171in a B<geometry> method).  I<NewGeometry> has
172the form B<=>I<width>B<x>I<height>B<+->I<x>B<+->I<y>, where
173any of B<=>, I<width>B<x>I<height>, or B<+->I<x>B<+->I<y>
174may be omitted.  I<Width> and I<height> are positive integers
175specifying the desired dimensions of I<$toplevel>.  If I<$toplevel>
176is gridded (see L<"GRIDDED GEOMETRY MANAGEMENT"> below) then the dimensions
177are specified in grid units;  otherwise they are specified in pixel
178units.  I<X> and I<y> specify the desired location of
179I<$toplevel> on the screen, in pixels.
180If I<x> is preceded by B<+>, it specifies
181the number of pixels between the left edge of the screen and the left
182edge of I<$toplevel>'s border;  if preceded by B<-> then
183I<x> specifies the number of pixels
184between the right edge of the screen and the right edge of I<$toplevel>'s
185border.  If I<y> is preceded by B<+> then it specifies the
186number of pixels between the top of the screen and the top
187of I<$toplevel>'s border;  if I<y> is preceded by B<-> then
188it specifies the number of pixels between the bottom of I<$toplevel>'s
189border and the bottom of the screen.
190If I<newGeometry> is specified as an empty string then any
191existing user-specified geometry for I<$toplevel> is cancelled, and
192the window will revert to the size requested internally by its
193widgets.
194
195=item I<$toplevel>-E<gt>B<wmGrid>(?I<baseWidth,baseHeight,widthInc,heightInc>?)
196
197This method indicates that I<$toplevel> is to be managed as a
198gridded window.
199It also specifies the relationship between grid units and pixel units.
200I<BaseWidth> and I<baseHeight> specify the number of grid
201units corresponding to the pixel dimensions requested internally
202by I<$toplevel> using B<Tk_GeometryRequest>.  I<WidthInc>
203and I<heightInc> specify the number of pixels in each horizontal
204and vertical grid unit.
205These four values determine a range of acceptable sizes for
206I<$toplevel>, corresponding to grid-based widths and heights
207that are non-negative integers.
208Tk will pass this information to the window manager;  during
209manual resizing, the window manager will restrict the window's size
210to one of these acceptable sizes.
211Furthermore, during manual resizing the window manager will display
212the window's current size in terms of grid units rather than pixels.
213If I<baseWidth> etc. are all specified as empty strings, then
214I<$toplevel> will no longer be managed as a gridded window.  If
215I<baseWidth> etc. are specified then the return value is an
216empty string.
217Otherwise the return value is a array containing
218four elements corresponding to the current I<baseWidth>,
219I<baseHeight>, I<widthInc>, and I<heightInc>;  if
220I<$toplevel> is not currently gridded, then an empty string
221is returned.
222Note: this command should not be needed very often, since the
223B<Tk_SetGrid> library procedure and the B<-setgrid> option
224provide easier access to the same functionality.
225
226=item I<$toplevel>-E<gt>B<group>(?I<$widget>?)
227
228If I<$widget> is specified, it is the the leader of
229a group of related windows.  The window manager may use this information,
230for example, to unmap all of the windows in a group when the group's
231leader is iconified.  I<$widget> may be specified as an empty string to
232remove I<$toplevel> from any group association.  If I<$widget> is
233specified then the method returns an empty string;  otherwise it
234returns the I<$toplevel>'s current group leader, or an empty
235string if I<$toplevel> isn't part of any group.
236
237=item I<$toplevel>-E<gt>B<iconbitmap>(?I<bitmap>?)
238
239If I<bitmap> is specified, then it names a bitmap in the standard
240forms accepted by Tk (see the B<Tk_GetBitmap> documentation for details).
241This I<black and white> bitmap is passed to the window manager to be displayed
242in I<$toplevel>'s icon, and the method returns an empty string.  If
243an empty string is specified for I<bitmap>, then any current icon
244bitmap or image is cancelled for I<$toplevel>.
245If I<bitmap> is specified then the method returns an empty string.
246Otherwise it returns the name of
247the current icon bitmap associated with I<$toplevel>, or an empty
248string if I<$toplevel> has no icon bitmap.
249
250=item I<$toplevel>-E<gt>B<iconify>
251
252Arrange for I<$toplevel> to be iconified.  It I<$toplevel> hasn't
253yet been mapped for the first time, this method will arrange for
254it to appear in the iconified state when it is eventually mapped.
255
256=item I<$toplevel>-E<gt>B<iconimage>(?I<image>?)
257
258If I<image> is specified, then it names a normal Tk image.
259This image is rendered into a private I<coloured> bitmap which is passed to
260the window manager to be displayed in I<$toplevel>'s icon, and the method returns
261an empty string. If an empty string is specified for I<image>, then any current
262icon bitmap or image is cancelled for I<$toplevel>.
263If I<image> is specified then the method returns an empty string.
264Otherwise it returns the name of
265the current icon image associated with I<$toplevel>, or an empty
266string if I<$toplevel> has no icon image.
267The private pixmap is not pre-cleared so images which are partly "transparent"
268display rubbish in their transparent parts.
269
270The sizes of images that can be used as icons in this manner are platform
271dependant. On Win32 this sets the "large" icon, which should be 32x32, it
272will automatically be scaled down to 16x16 for use as a small icon.
273
274=item I<$toplevel>-E<gt>B<iconmask>(?I<bitmap>?)
275
276If I<bitmap> is specified, then it names a bitmap in the standard
277forms accepted by Tk (see the B<Tk_GetBitmap> documentation for details).
278This bitmap is passed to the window manager to be used as a mask
279in conjunction with the B<iconbitmap> option:  where the mask
280has zeroes no icon will be displayed;  where it has ones, the bits
281from the icon bitmap will be displayed.  If
282an empty string is specified for I<bitmap> then any current icon
283mask is cancelled for I<$toplevel> (this is equivalent to specifying
284a bitmap of all ones).  If I<bitmap> is specified
285then the method returns an empty string.  Otherwise it
286returns the name of the current icon mask associated with
287I<$toplevel>, or an empty string if no mask is in effect.
288
289=item I<$toplevel>-E<gt>B<iconname>(?I<newName>?)
290
291If I<newName> is specified, then it is passed to the window
292manager;  the window manager should display I<newName> inside
293the icon associated with I<$toplevel>.  In this case an empty
294string is returned as result.  If I<newName> isn't specified
295then the method returns the current icon name for I<$toplevel>,
296or an empty string if no icon name has been specified (in this
297case the window manager will normally display the window's title,
298as specified with the B<title> method).
299
300=item I<$toplevel>-E<gt>B<iconphoto>(?-default? I<image1> ?I<image2>
301...?)
302
303Sets the titlebar icon for  window  based  on  the  named  photo
304images.  If -default is specified, this is applied to all future
305created toplevels as well.  The data in the images is taken as a
306snapshot  at  the  time  of invocation.  If the images are later
307changed, this is not reflected to the titlebar icons.   Multiple
308images  are  accepted to allow different images sizes (eg, 16x16
309and 32x32) to be provided.  The window manager  may  scale  pro-
310vided icons to an appropriate size.
311
312On Windows, the images are packed into a Windows icon structure.
313This will override an ico specified to wm iconbitmap,  and  vice
314versa. [NOTE: This is not implemented yet!]
315
316On  X, the images are arranged into the _NET_WM_ICON X property,
317which most modern window managers support.  A wm iconbitmap  may
318exist  simultaneously.  It is recommended to use not more than 2
319icons, placing the larger icon first.
320
321On Macintosh, this is currently does nothing.
322
323=item I<$toplevel>-E<gt>B<iconposition>(?I<x y>?)
324
325If I<x> and I<y> are specified, they are passed to the window
326manager as a hint about where to position the icon for I<$toplevel>.
327In this case an empty string is returned.  If I<x> and I<y> are
328specified as empty strings then any existing icon position hint is cancelled.
329If neither I<x> nor I<y> is specified, then the method returns
330a array containing two values, which are the current icon position
331hints (if no hints are in effect then an empty string is returned).
332
333=item I<$toplevel>-E<gt>B<iconwindow>(?I<$widget>?)
334
335If I<$widget> is specified, it is a window to
336use as icon for I<$toplevel>: when I<$toplevel> is iconified then
337I<$widget> will be mapped to serve as icon, and when I<$toplevel>
338is de-iconified then I<$widget> will be unmapped again.  If
339I<$widget> is specified as an empty string then any existing
340icon window association for I<$toplevel> will be cancelled.  If
341the I<$widget> argument is specified then an empty string is
342returned.  Otherwise the method returns the
343current icon window for I<$toplevel>, or an empty string if there
344is no icon window currently specified for I<$toplevel>.
345Button press events are disabled for I<$toplevel> as long as it is
346an icon window;  this is needed in order to allow window managers
347to ``own'' those events.
348Note: not all window managers support the notion of an icon window.
349
350=item I<$toplevel>-E<gt>B<maxsize>(?I<width,height>?)
351
352If I<width> and I<height> are specified, they give
353the maximum permissible dimensions for I<$toplevel>.
354For gridded windows the dimensions are specified in
355grid units;  otherwise they are specified in pixel units.
356The window manager will restrict the window's dimensions to be
357less than or equal to I<width> and I<height>.
358If I<width> and I<height> are
359specified, then the method returns an empty string.  Otherwise
360it returns a array with two elements, which are the
361maximum width and height currently in effect.
362The maximum size defaults to the size of the screen.
363If resizing has been disabled with the B<resizable> method,
364then this method has no effect.
365See the sections on geometry management below for more information.
366
367=item I<$toplevel>-E<gt>B<minsize>(?I<width,height>?)
368
369If I<width> and I<height> are specified, they give the
370minimum permissible dimensions for I<$toplevel>.
371For gridded windows the dimensions are specified in
372grid units;  otherwise they are specified in pixel units.
373The window manager will restrict the window's dimensions to be
374greater than or equal to I<width> and I<height>.
375If I<width> and I<height> are
376specified, then the method returns an empty string.  Otherwise
377it returns a array with two elements, which are the
378minimum width and height currently in effect.
379The minimum size defaults to one pixel in each dimension.
380If resizing has been disabled with the B<resizable> method,
381then this method has no effect.
382See the sections on geometry management below for more information.
383
384=item I<$toplevel>-E<gt>B<overrideredirect(?>I<boolean>?)
385
386If I<boolean> is specified, it must have a proper boolean form and
387the override-redirect flag for I<$toplevel> is set to that value.
388If I<boolean> is not specified then B<1> or B<0> is
389returned to indicate whether or not the override-redirect flag
390is currently set for I<$toplevel>.
391Setting the override-redirect flag for a window causes
392it to be ignored by the window manager;  among other things, this means
393that the window will not be reparented from the root window into a
394decorative frame and the user will not be able to manipulate the
395window using the normal window manager mechanisms.
396
397=item I<$toplevel>-E<gt>B<positionfrom>(?I<who>?)
398
399If I<who> is specified, it must be either B<program> or
400B<user>, or an abbreviation of one of these two.  It indicates
401whether I<$toplevel>'s current position was requested by the
402program or by the user.  Many window managers ignore program-requested
403initial positions and ask the user to manually position the window;  if
404B<user> is specified then the window manager should position the
405window at the given place without asking the user for assistance.
406If I<who> is specified as an empty string, then the current position
407source is cancelled.
408If I<who> is specified, then the method returns an empty string.
409Otherwise it returns B<user> or $widget to indicate the
410source of the window's current position, or an empty string if
411no source has been specified yet.  Most window managers interpret
412``no source'' as equivalent to B<program>.
413Tk will automatically set the position source to B<user>
414when a B<geometry> method is invoked, unless the source has
415been set explicitly to B<program>.
416
417=item I<$toplevel>-E<gt>B<protocol>(?I<name>?,?I<callback>?)
418
419This method is used to manage window manager protocols such as
420B<WM_DELETE_WINDOW>.
421I<Name> is the name of an atom corresponding to a window manager
422protocol, such as B<WM_DELETE_WINDOW> or B<WM_SAVE_YOURSELF>
423or B<WM_TAKE_FOCUS>.
424If both I<name> and I<callback> are specified, then I<callback>
425is associated with the protocol specified by I<name>.
426I<Name> will be added to I<$toplevel>'s B<WM_PROTOCOLS>
427property to tell the window manager that the application has a
428protocol handler for I<name>, and I<callback> will
429be invoked in the future whenever the window manager sends a
430message to the client for that protocol.
431In this case the method returns an empty string.
432If I<name> is specified but I<callback> isn't, then the current
433callback for I<name> is returned, or an empty string if there
434is no handler defined for I<name>.
435If I<callback> is specified as an empty string then the current
436handler for I<name> is deleted and it is removed from the
437B<WM_PROTOCOLS> property on I<$toplevel>;  an empty string is
438returned.
439Lastly, if neither I<name> nor I<callback> is specified, the
440method returns a list of all the protocols for which handlers
441are currently defined for I<$toplevel>.
442
443=over 8
444
445Tk always defines a protocol handler for B<WM_DELETE_WINDOW>, even if
446you haven't asked for one with B<protocol>.
447If a B<WM_DELETE_WINDOW> message arrives when you haven't defined
448a handler, then Tk handles the message by destroying the window for
449which it was received.
450
451=back
452
453=item I<$toplevel>-E<gt>B<resizable>(?I<width,height>?)
454
455This method controls whether or not the user may interactively
456resize a top-level window.  If I<width> and I<height> are
457specified, they are boolean values that determine whether the
458width and height of I<$toplevel> may be modified by the user.
459In this case the method returns an empty string.
460If I<width> and I<height> are omitted then the method
461returns a list with two 0/1 elements that indicate whether the
462width and height of I<$toplevel> are currently resizable.
463By default, windows are resizable in both dimensions.
464If resizing is disabled, then the window's size will be the size
465from the most recent interactive resize or B<geometry>
466method.  If there has been no such operation then
467the window's natural size will be used.
468
469=item I<$toplevel>-E<gt>B<sizefrom>(?I<who>?)
470
471If I<who> is specified, it must be either B<program> or
472B<user>, or an abbreviation of one of these two.  It indicates
473whether I<$toplevel>'s current size was requested by the
474program or by the user.  Some window managers ignore program-requested
475sizes and ask the user to manually size the window;  if
476B<user> is specified then the window manager should give the
477window its specified size without asking the user for assistance.
478If I<who> is specified as an empty string, then the current size
479source is cancelled.
480If I<who> is specified, then the method returns an empty string.
481Otherwise it returns B<user> or $widget to indicate the
482source of the window's current size, or an empty string if
483no source has been specified yet.  Most window managers interpret
484``no source'' as equivalent to B<program>.
485
486=item I<$toplevel>-E<gt>B<stackorder>( I<?isabove|isbelow $toplevel?> );
487
488The stackorder command returns a list  of  toplevel  windows  in
489stacking  order,  from lowest to highest. When a single toplevel
490window is passed, the returned list recursively includes all  of
491the  window's  children that are toplevels. Only those toplevels
492that are currently mapped  to  the  screen  are  returned.   The
493stackorder command can also be used to determine if one toplevel
494is positioned above or below a second toplevel.  When two window
495arguments  separated  by either isabove or isbelow are passed, a
496boolean result indicates whether or not the first window is
497currently above or below the second window in the stacking order.
498
499
500=item I<$toplevel>-E<gt>B<state>(?I<newstate>?)
501
502If I<newstate> is specified, the window will be set to
503the new state, otherwise it returns the current state of
504I<$toplevel>: either B<normal>, B<iconic>, B<withdrawn>, B<icon>, or
505(Windows only) B<zoomed>. The
506difference between B<iconic> and B<icon> is that B<iconic> refers to a
507window that has been iconified (e.g., with the B<iconify> method)
508while B<icon> refers to a window whose only purpose is to serve as the
509icon for some other window (via the B<iconwindow> method). The
510B<icon> state cannot be set.
511
512
513=item I<$toplevel>-E<gt>B<title>(?I<string>?)
514
515If I<string> is specified, then it will be passed to the window
516manager for use as the title for I<$toplevel> (the window manager
517should display this string in I<$toplevel>'s title bar).  In this
518case the method returns an empty string.  If I<string> isn't
519specified then the method returns the current title for the
520I<$toplevel>.  The title for a window defaults to its name.
521
522=item I<$toplevel>-E<gt>B<transient>(?I<master>?)
523
524If I<master> is specified, then the window manager is informed
525that I<$toplevel> is a transient window (e.g. pull-down menu) working
526on behalf of I<master> (where I<master> is
527a top-level window).  Some window managers will use
528this information to manage I<$toplevel> specially.  If I<master>
529is specified as an empty string then I<$toplevel> is marked as not
530being a transient window any more.  If I<master> is specified,
531then the method returns an empty string.  Otherwise the method
532returns the path name of I<$toplevel>'s current master, or an
533empty string if I<$toplevel> isn't currently a transient window.
534
535=item I<$toplevel>-E<gt>B<withdraw>
536
537Arranges for I<$toplevel> to be withdrawn from the screen.  This
538causes the window to be unmapped and forgotten about by the window
539manager.  If the window
540has never been mapped, then this method
541causes the window to be mapped in the withdrawn state.  Not all
542window managers appear to know how to handle windows that are
543mapped in the withdrawn state.
544Note: it sometimes seems to be necessary to withdraw a
545window and then re-map it (e.g. with B<deiconify>) to get some
546window managers to pay attention to changes in window attributes
547such as group.
548
549=item I<$toplevel>-E<gt>B<wrapper>
550
551Returns a list of two elements: the window id of the wrapper window in
552which Tk has placed I<$toplevel>, and the height of the menu bar. The
553id is the one by which window manager will know I<$toplevel>, and so
554is appropriate place to add X properties. The menu height is only
555returned on X. On Windows, this value is always zero.
556
557=back
558
559=head1 ICON SIZES
560
561The sizes of bitmaps/images that can be used as icons in this manner are platform
562and window manager dependant. Unix window managers are typically more tolerant
563than Win32. It is possible that coloured C<iconimage> icons may cause problems
564on some X window managers.
565
566=over 4
567
568=item * Win32
569
570C<iconimage> and C<iconbitmap> set the "large" icon, which should be
57132x32, it will automatically be scaled down to 16x16 for use as a small icon.
572Win32 ignores C<iconwin> requests.
573
574=item * KDE's "kwm"
575
576Accepts coloured C<iconimage> and black and white C<iconbitmap> but
577will scale either to a small (14x14?) icon. Kwm ignores C<iconwin>.
578
579=item * Sun's "olwm" or "olvwm"
580
581Honours C<iconwin> which will override C<iconimage> or C<iconbitmap>.
582Coloured images work.
583
584=item * Sun's CDE window manager
585
586Coloured images work. ...
587
588=back
589
590=head1 GEOMETRY MANAGEMENT
591
592By default a top-level window appears on the screen in its
593I<natural size>, which is the one determined internally by its
594widgets and geometry managers.
595If the natural size of a top-level window changes, then the window's size
596changes to match.
597A top-level window can be given a size other than its natural size in two ways.
598First, the user can resize the window manually using the facilities
599of the window manager, such as resize handles.
600Second, the application can request a particular size for a
601top-level window using the B<geometry> method.
602These two cases are handled identically by Tk;  in either case,
603the requested size overrides the natural size.
604You can return the window to its natural by invoking B<geometry>
605with an empty I<geometry> string.
606
607Normally a top-level window can have any size from one pixel in each
608dimension up to the size of its screen.
609However, you can use the B<minsize> and B<maxsize> methods
610to limit the range of allowable sizes.
611The range set by B<minsize> and B<maxsize> applies to
612all forms of resizing, including the window's natural size as
613well as manual resizes and the B<geometry> method.
614You can also use the method B<resizable> to completely
615disable interactive resizing in one or both dimensions.
616
617=head1 GRIDDED GEOMETRY MANAGEMENT
618
619Gridded geometry management occurs when one of the widgets of an
620application supports a range of useful sizes.
621This occurs, for example, in a text editor where the scrollbars,
622menus, and other adornments are fixed in size but the edit widget
623can support any number of lines of text or characters per line.
624In this case, it is usually desirable to let the user specify the
625number of lines or characters-per-line, either with the
626B<geometry> method or by interactively resizing the window.
627In the case of text, and in other interesting cases also, only
628discrete sizes of the window make sense, such as integral numbers
629of lines and characters-per-line;  arbitrary pixel sizes are not useful.
630
631Gridded geometry management provides support for this kind of
632application.
633Tk (and the window manager) assume that there is a grid of some
634sort within the application and that the application should be
635resized in terms of I<grid units> rather than pixels.
636Gridded geometry management is typically invoked by turning on
637the B<setGrid> option for a widget;  it can also be invoked
638with the B<wmGrid> method or by calling B<Tk_SetGrid>.
639In each of these approaches the particular widget (or sometimes
640code in the application as a whole) specifies the relationship between
641integral grid sizes for the window and pixel sizes.
642To return to non-gridded geometry management, invoke
643B<grid> with empty argument strings.
644
645When gridded geometry management is enabled then all the dimensions specified
646in B<minsize>, B<maxsize>, and B<geometry> methods
647are treated as grid units rather than pixel units.
648Interactive resizing is also carried out in even numbers of grid units
649rather than pixels.
650
651=head1 BUGS
652
653Most existing window managers appear to have bugs that affect the
654operation of the B<wm> methods.  For example, some changes won't
655take effect if the window is already active:  the window will have
656to be withdrawn and de-iconified in order to make the change happen.
657
658=head1 SEE ALSO
659
660L<Tk::Widget|Tk::Widget>
661L<Tk::tixWm|Tk::tixWm>
662L<Tk::Mwm|Tk::Mwm>
663
664=head1 KEYWORDS
665
666aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager
667
668=cut
669
670