1Tk_SetGrid(3) Tk Library Procedures Tk_SetGrid(3)
2
3
4
5______________________________________________________________________________
6
8 Tk_SetGrid, Tk_UnsetGrid - control the grid for interactive resizing
9
11 #include <tk.h>
12
13 Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
14
15 Tk_UnsetGrid(tkwin)
16
18 Tk_Window tkwin (in) Token for window.
19
20 int reqWidth (in) Width in grid units that corresponds
21 to the pixel dimension tkwin has re‐
22 quested via Tk_GeometryRequest.
23
24 int reqHeight (in) Height in grid units that corresponds
25 to the pixel dimension tkwin has re‐
26 quested via Tk_GeometryRequest.
27
28 int widthInc (in) Width of one grid unit, in pixels.
29
30 int heightInc (in) Height of one grid unit, in pixels.
31______________________________________________________________________________
32
34 Tk_SetGrid turns on gridded geometry management for tkwin's toplevel
35 window and specifies the geometry of the grid. Tk_SetGrid is typically
36 invoked by a widget when its setGrid option is true. It restricts in‐
37 teractive resizing of tkwin's toplevel window so that the space allo‐
38 cated to the toplevel is equal to its requested size plus or minus even
39 multiples of widthInc and heightInc. Furthermore, the reqWidth and re‐
40 qHeight values are passed to the window manager so that it can report
41 the window's size in grid units during interactive resizes. If tkwin's
42 configuration changes (e.g., the size of a grid unit changes) then the
43 widget should invoke Tk_SetGrid again with the new information.
44
45 Tk_UnsetGrid cancels gridded geometry management for tkwin's toplevel
46 window.
47
48 For each toplevel window there can be at most one internal window with
49 gridding enabled. If Tk_SetGrid or Tk_UnsetGrid is invoked when some
50 other window is already controlling gridding for tkwin's toplevel, the
51 calls for the new window have no effect.
52
53 See the wm manual entry for additional information on gridded geometry
54 management.
55
57 grid, window, window manager
58
59
60
61Tk 4.0 Tk_SetGrid(3)