1Geometry(3) Tile Widget Set Geometry(3)
2
3
4
6 geometry: Ttk_MakeBox, Ttk_PadBox, Ttk_ExpandBox, Ttk_PackBox,
7 Ttk_StickBox, Ttk_PlaceBox, Ttk_BoxContains, Ttk_MakePadding, Ttk_Uni‐
8 formPadding, Ttk_AddPadding, Ttk_RelievePadding, Ttk_GetPaddingFromObj,
9 Ttk_GetBorderFromObj, Ttk_GetStickyFromObj - Geometry utilities
10
12 #include <tkTheme.h>
13
14 Ttk_Box
15 Ttk_MakeBox(int x, int y, int width, int height);
16
17 Ttk_Box
18 Ttk_PadBox(Ttk_Box parcel, Ttk_Padding padding);
19
20 Ttk_Box
21 Ttk_ExpandBox(Ttk_Box parcel, Ttk_Padding padding);
22
23 Ttk_Box
24 Ttk_PackBox(Ttk_Box *cavity, int width, int height, Ttk_Side side);
25
26 Ttk_Box
27 Ttk_StickBox(Ttk_Box parcel, int width, int height, unsigned sticky);
28
29 Ttk_Box
30 Ttk_PlaceBox(Ttk_Box *cavity, int width, int height, Ttk_Side side, unsigned sticky);
31
32 Ttk_Box
33 Ttk_AnchorBox(Ttk_Box parcel, int width, int height, Tk_Anchor anchor);
34
35 Ttk_Padding
36 Ttk_MakePadding(short left, short top, short right, short bottom);
37
38 Ttk_Padding
39 Ttk_UniformPadding(short border);
40
41 Ttk_Padding
42 Ttk_AddPadding(Ttk_Padding padding1, Ttk_Padding padding2;
43
44 Ttk_Padding
45 Ttk_RelievePadding(Ttk_Padding padding, int relief);
46
47 int
48 Ttk_BoxContains(Ttk_Box box, int x, int y);
49
50 int
51 Ttk_GetPaddingFromObj(
52 Tcl_Interp *interp, Tk_Window tkwin,
53 Tcl_Obj *objPtr, Ttk_Padding *padding_rtn);
54
55 int
56 Ttk_GetBorderFromObj(
57 Tcl_Interp *interp, Tcl_Obj *objPtr, Ttk_Padding *padding_rtn);
58
59 int
60 Ttk_GetStickyFromObj(Tcl_Interp *interp, Tcl_Obj *objPtr, int *sticky_rtn);
61
63 One of the symbolic constants TK_ANCHOR_N, TK_ANCHOR_NE, etc. See
64 Tk_GetAnchorFromObj(3). A rectangular region from which a parcel is
65 allocated. Extra padding (in pixels) to add uniformly to each side of
66 a region. Extra padding (in pixels) to add to the bottom of a region.
67 Specifies a rectangular region. The height in pixels of a region.
68 Used to store error messages. Extra padding (in pixels) to add to the
69 left side of a region. String value contains a symbolic name to be
70 converted to an enumerated value or bitmask. Internal rep may be be
71 modified to cache corresponding value. Extra padding to add on the
72 inside of a region. A rectangular region, allocated from a cavity.
73 One of the standard Tk relief options (TK_RELIEF_RAISED,
74 TK_RELIEF_SUNKEN, etc.). See Tk_GetReliefFromObj. Extra padding (in
75 pixles) to add to the right side of a region. One of TTK_SIDE_LEFT,
76 TTK_SIDE_TOP, TTK_SIDE_RIGHT, or TTK_SIDE_BOTTOM. A bitmask containing
77 one or more of the bits TTK_STICK_W (west, or left), TTK_STICK_E (east,
78 or right, TTK_STICK_N (north, or top), and TTK_STICK_S (south, or bot‐
79 tom). TTK_FILL_X is defined as a synonym for
80 (TTK_STICK_W|TTK_STICK_E), TTK_FILL_Y is a synonym for
81 (TTK_STICK_N|TTK_STICK_S), and TTK_FILL_BOTH and TTK_STICK_ALL are
82 synonyms for (TTK_FILL_X|TTK_FILL_Y). See also: grid(n). Window whose
83 screen geometry determines the conversion between absolute units and
84 pixels. Extra padding at the top of a region. The width in pixels of
85 a region. X coordinate of upper-left corner of region. Y coordinate
86 of upper-left corner of region.
87
88
90 The Ttk_Box structure represents a rectangular region of a window:
91 typedef struct {
92 int x;
93 int y;
94 int width;
95 int height; } Ttk_Box; All coordinates are relative to the window.
96
97 Ttk_MakeBox is a convenience routine that contsructs a Ttk_Box struc‐
98 ture representing a region width pixels wide, height pixels tall, at
99 the specified x, y coordinates.
100
101 Ttk_PadBox returns a new box located inside the specified parcel,
102 shrunken according to the left, top, right, and bottom margins speci‐
103 fied by padding.
104
105 Ttk_ExpandBox is the inverse of Ttk_PadBox: it returns a new box sur‐
106 rounding the specified parcel, expanded according to the left, top,
107 right, and bottom margins specified by padding.
108
109 Ttk_PackBox allocates a parcel width by height pixels wide on the spec‐
110 ified side of the cavity, and shrinks the cavity accordingly.
111
112 Ttk_StickBox places a box with the requested width and height inside
113 the parcel according to the sticky bits.
114
115 Ttk_PlaceBox combines Ttk_PackBox and Ttk_StickBox: it allocates a par‐
116 cel on the specified side of the cavity, places a box of the requested
117 size inside the parcel according to sticky, and shrinks the cavity.
118
119 Ttk_AnchorBox places a box with the requested width and height inside
120 the parcel according to the specified anchor option.
121
122 Ttk_BoxContains tests if the specified x, y coordinate lies within the
123 rectangular region box.
124
126 The Ttk_Padding structure is used to represent borders, internal pad‐
127 ding, and external margins: typedef struct {
128 short left;
129 short top;
130 short right;
131 short bottom; } Ttk_Padding;
132
133 Ttk_MakePadding is a convenience routine that contsructs a Ttk_Padding
134 structure with the specified left, top, right, and bottom components.
135
136 Ttk_UniformPadding constructs a Ttk_Padding structure with all compo‐
137 nents equal to the specified border.
138
139 Ttk_AddPadding adds two Ttk_Paddings together and returns a combined
140 padding containing the sum of the individual padding components.
141
142 Ttk_RelievePadding adds an extra 2 pixels of padding to padding accord‐
143 ing to the specified relief. If relief is TK_RELIEF_SUNKEN, adds two
144 pixels at the top and left so the inner region is shifted down and to
145 the left. If it is TK_RELIEF_RAISED, adds two pixels at the bottom and
146 right so the inner region is shifted up and to the right. Otherwise,
147 adds 1 pixel on all sides. This is typically used in element geometry
148 procedures to simulate a "pressed-in" look for pushbuttons.
149
150
152 Ttk_GetPaddingFromObj converts the string in objPtr to a Ttk_Padding
153 structure. The string representation is a list of up to four length
154 specifications "left top right bottom". If fewer than four elements
155 are specified, bottom defaults to top, right defaults to left, and top
156 defaults to left. See Tk_GetPixelsFromObj(3) for the syntax of length
157 specifications.
158
159 Ttk_GetBorderFromObj is the same as Ttk_GetPaddingFromObj except that
160 the lengths are specified as integers (i.e., resolution-dependant val‐
161 ues like 3m are not allowed).
162
163 Ttk_GetStickyFromObj converts the string in objPtr to a sticky bitmask.
164 The string contains zero or more of the characters n, s, e, or w.
165
166
168 Tk_GetReliefFromObj(3), Tk_GetPixelsFromObj(3), Tk_GetAnchorFromObj(3)
169
170
172 geometry, padding, margins, box, region, sticky, relief
173
174
175
176tile 0.2 Geometry(3)