| 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_SetGrid, Tk_UnsetGrid - control the grid for interactive resizing |
| 11 |
|
| 12 |
=for category C Programming |
| 13 |
|
| 14 |
=head1 SYNOPSIS |
| 15 |
|
| 16 |
B<#include E<lt>tk.hE<gt>> |
| 17 |
|
| 18 |
B<Tk_SetGrid>(I<tkwin, reqWidth, reqHeight, widthInc, heightInc>) |
| 19 |
|
| 20 |
B<Tk_UnsetGrid>(I<tkwin>) |
| 21 |
|
| 22 |
=head1 ARGUMENTS |
| 23 |
|
| 24 |
=over 4 |
| 25 |
|
| 26 |
=item Tk_Window tkwin (in) |
| 27 |
|
| 28 |
Token for window. |
| 29 |
|
| 30 |
=item int reqWidth (in) |
| 31 |
|
| 32 |
Width in grid units that corresponds to the pixel dimension I<tkwin> |
| 33 |
has requested via B<Tk_GeometryRequest>. |
| 34 |
|
| 35 |
=item int reqHeight (in) |
| 36 |
|
| 37 |
Height in grid units that corresponds to the pixel dimension I<tkwin> |
| 38 |
has requested via B<Tk_GeometryRequest>. |
| 39 |
|
| 40 |
=item int widthInc (in) |
| 41 |
|
| 42 |
Width of one grid unit, in pixels. |
| 43 |
|
| 44 |
=item int heightInc (in) |
| 45 |
|
| 46 |
Height of one grid unit, in pixels. |
| 47 |
|
| 48 |
=back |
| 49 |
|
| 50 |
=head1 DESCRIPTION |
| 51 |
|
| 52 |
B<Tk_SetGrid> turns on gridded geometry management for I<tkwin>'s |
| 53 |
toplevel window and specifies the geometry of the grid. |
| 54 |
B<Tk_SetGrid> is typically invoked by a widget when its B<setGrid> |
| 55 |
option is true. |
| 56 |
It restricts interactive resizing of I<tkwin>'s toplevel window so |
| 57 |
that the space allocated to the toplevel is equal to its requested |
| 58 |
size plus or minus even multiples of I<widthInc> and I<heightInc>. |
| 59 |
Furthermore, the I<reqWidth> and I<reqHeight> values are |
| 60 |
passed to the window manager so that it can report the window's |
| 61 |
size in grid units during interactive resizes. |
| 62 |
If I<tkwin>'s configuration changes (e.g., the size of a grid unit |
| 63 |
changes) then the widget should invoke B<Tk_SetGrid> again with the new |
| 64 |
information. |
| 65 |
|
| 66 |
B<Tk_UnsetGrid> cancels gridded geometry management for |
| 67 |
I<tkwin>'s toplevel window. |
| 68 |
|
| 69 |
For each toplevel window there can be at most one internal window |
| 70 |
with gridding enabled. |
| 71 |
If B<Tk_SetGrid> or B<Tk_UnsetGrid> is invoked when some |
| 72 |
other window is already controlling gridding for I<tkwin>'s |
| 73 |
toplevel, the calls for the new window have no effect. |
| 74 |
|
| 75 |
See the B<wm> documentation for additional information on gridded geometry |
| 76 |
management. |
| 77 |
|
| 78 |
=head1 KEYWORDS |
| 79 |
|
| 80 |
grid, window, window manager |