OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [man/] [compound.html] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
 
2
 
3
 
4
<TITLE>Compound - Create multi-line compound images.</TITLE>
5
<Center><H2>Compound - Create multi-line compound images.</H2></Center><hr>
6
 
7
</pre><H3>SYNOPSIS</H3>
8
<B>image create compound </B></I>?<I>name</I></B>? ?<I>options</I></B>?
9
</pre><HR>
10
</pre><H3>DESCRIPTION</H3>
11
<P>
12
Compound image types can be used to create images that consists of
13
multiple horizontal lines; each line is composed of a series of items
14
(texts, bitmaps, images or spaces) arranged from left to
15
right. Compound images are mainly used to embed complex drawings into
16
widgets that support the <B>-image</B></I> option. As shown in the EXAMPLE
17
section below, a compound image can be used to display a bitmap and a
18
text string simutaneously in a TK <B>button(n)</B></I> widget.
19
</pre><H3>CREATING COMPOUND IMAGES</H3>
20
<P>
21
Like all images, compound images are created using the <B>image create</B></I>
22
command. Compound images support the following <I>options</I></B>:
23
<DL>
24
<DT> <B>-background <I>color</I></B>
25
</I></B>
26
<DD> Specifies the background color of the compound image. This color is
27
also used as the default background color for the bitmap items in the
28
compound image.
29
</DL>
30
<DL>
31
<DT> <B>-borderwidth <I>pixels</I></B>
32
</I></B>
33
<DD> Specifies a non-negative value indicating the width of the 3-D border
34
drawn around the compound image.
35
</DL>
36
<DL>
37
<DT> <B>-font <I>font</I></B>
38
</I></B>
39
<DD> Specifies the default font for the text items in the compound image.
40
</DL>
41
<DL>
42
<DT> <B>-foreground <I>color</I></B>
43
</I></B>
44
<DD> Specifies the default foreground color for the bitmap and text items
45
in the compound image.
46
</DL>
47
<DL>
48
<DT> <B>-padx <I>value</I></B>
49
</I></B>
50
<DD> Specifies a non-negative value indicating how much extra space to
51
request for the compound image in the X-direction. The <I>value</I></B> may
52
have any of the forms acceptable to <B>Tk_GetPixels(3)</B></I>.
53
</DL>
54
<DL>
55
<DT> <B>-pady <I>value</I></B>
56
</I></B>
57
<DD> Specifies a non-negative value indicating how much extra space to
58
request for the compound image in the Y-direction.
59
</DL>
60
<DL>
61
<DT> <B>-relief <I>value</I></B>
62
</I></B>
63
<DD> Specifies the 3-D effect desired for the background of the compound
64
image. Acceptable values are <B>raised</B></I>, <B>sunken</B></I>, <B>flat</B></I>,
65
<B>ridge</B></I>, and <B>groove</B></I>.
66
</DL>
67
<DL>
68
<DT> <B>-showbackground <I>value</I></B>
69
</I></B>
70
<DD> Specifies whether the background and the 3D borders should be drawn.
71
Must be a valid boolean value. By default the background is not drawn
72
and the compound image appears to have a transparent background.
73
</DL>
74
<DL>
75
<DT> <B>-window <I>pathName</I></B>
76
</I></B>
77
<DD> Specifies the window in which the compound image is displayed. One
78
compound image can be displayed in only one window. When that window
79
is destroyed, the compound image is automatically destroyed as well.
80
This option must be specified when calling the <B>image create
81
compound</B></I> command and cannot be changed by the <B>configure</B></I> image
82
command.
83
</DL>
84
</pre><H3>IMAGE COMMAND</H3>
85
<P>
86
When a compound image is created, Tk also creates a new command whose
87
name is the same as the image. This command may be used to invoke
88
various operations on the image. It has the following general form:
89
<pre>
90
<I>imageName option </I></B>?<I>arg arg ...</I></B>?
91
</pre>
92
<I>Option</I></B> and the <I>arg</I></B>s
93
determine the exact behavior of the command. The following
94
commands are possible for compound images:
95
<DL>
96
<DT> <I>imageName <B>add line</B></I> ?<I>option value ...</I></B>?
97
</I></B>
98
<DD> Creates a new line at the bottom of the compound image. Lines support
99
the following <I>options</I></B>:
100
</DL>
101
<UL>
102
<DL>
103
<DT> <B>-anchor</B></I> value
104
</I></B>
105
<DD> Specifies how the line should be aligned along the horizontal axis.
106
When the values are <B>w</B></I>, <B>sw</B></I> or <B>nw</B></I>, the line is aligned
107
to the left. When the values are <B>c</B></I>, <B>s</B></I> or <B>n</B></I>, the line
108
is aligned to the middle.  When the values are <B>e</B></I>, <B>se</B></I> or
109
<B>ne</B></I>, the line is aligned to the right.
110
</DL>
111
<DL>
112
<DT> <B>-padx <I>value</I></B>
113
</I></B>
114
<DD> Specifies a non-negative value indicating how much extra space to
115
request for this line in the X-direction.
116
</DL>
117
</UL>
118
<DL>
119
<DT> <I>imageName <B>add <I>item-type</I></B> ?<I>option value ...</I></B>?
120
</I></B>
121
<DD> Creates a new item of the type <I>item-type</I></B> at the end of the last
122
line of the compound image. All types of items support
123
these following common <I>options</I></B>:
124
</DL>
125
<UL>
126
<DL>
127
<DT> <B>-anchor</B></I> value
128
</I></B>
129
<DD> Specifies how the item should be aligned along the vertical axis. When
130
the values are <B>n</B></I>, <B>nw</B></I> or <B>ne</B></I>, the item is aligned to
131
the top of the line. When the values are <B>c</B></I>, <B>w</B></I> or <B>e</B></I>,
132
the item is aligned to the middle of the line.  When the values are
133
<B>s</B></I>, <B>se</B></I> or <B>sw</B></I>, the item is aligned to the bottom of
134
the line.
135
</DL>
136
<DL>
137
<DT> <B>-padx <I>value</I></B>
138
</I></B>
139
<DD> Specifies a non-negative value indicating how much extra space to
140
request for this item in the X-direction.
141
</DL>
142
<DL>
143
<DT> <B>-pady <I>value</I></B>
144
</I></B>
145
<DD> Specifies a non-negative value indicating how much extra space to
146
request for this item in the Y-direction.
147
</DL>
148
<DL>
149
<DT> <I>item-type</I></B> can be any of the following:
150
</DL>
151
</UL>
152
<DL>
153
<DT> <I>imageName <B>add bitmap</B></I> ?<I>option value ...</I></B>?
154
</I></B>
155
<DD> Creates a new bitmap item of at the end of the last
156
line of the compound image. Additional <I>options</I></B> accepted by the
157
bitmap type are:
158
</DL>
159
<UL>
160
<DL>
161
<DT> <B>-background <I>color</I></B>
162
</I></B>
163
<DD> Specifies the background color of the bitmap item.
164
</DL>
165
<DL>
166
<DT> <B>-bitmap <I>name</I></B>
167
</I></B>
168
<DD> Specifies a bitmap to display in this item, in any of the forms
169
acceptable to <B>Tk_GetBitmap(3)</B></I>.
170
</DL>
171
<DL>
172
<DT> <B>-foreground <I>color</I></B>
173
</I></B>
174
<DD> Specifies the foreground color of the bitmap item.
175
</DL>
176
</UL>
177
<DL>
178
<DT> <I>imageName <B>add image</B></I> ?<I>option value ...</I></B>?
179
</I></B>
180
<DD> Creates a new image item of at the end of the last
181
line of the compound image. Additional <I>options</I></B> accepted by the
182
image type are:
183
</DL>
184
<UL>
185
<DL>
186
</DL>
187
<DL>
188
<DT> <B>-image <I>name</I></B>
189
</I></B>
190
<DD> Specifies an image to display in this item. <I>name</I></B>
191
must have been created with the <B>image create</B></I> command.
192
</DL>
193
</UL>
194
<DL>
195
<DT> <I>imageName <B>add space</B></I> ?<I>option value ...</I></B>?
196
</I></B>
197
<DD> Creates a new space item of at the end of the last line of the
198
compound image. Space items do not display anything. They just acts as
199
space holders that add additional spaces between items inside a
200
compound image. Additional <I>options</I></B> accepted by the image type
201
are:
202
</DL>
203
<UL>
204
<DL>
205
</DL>
206
<DL>
207
<DT> <B>-width <I>value</I></B>
208
</I></B>
209
<DD> Specifies the width of this space. The <I>value</I></B> may have any of the
210
forms acceptable to <B>Tk_GetPixels(3)</B></I>.
211
</DL>
212
<DL>
213
<DT> <B>-height <I>value</I></B>
214
</I></B>
215
<DD> Specifies the height of this space. The <I>value</I></B> may have any of
216
the forms acceptable to <B>Tk_GetPixels(3)</B></I>.
217
</DL>
218
</UL>
219
<DL>
220
<DT> <I>imageName <B>add text</B></I> ?<I>option value ...</I></B>?
221
</I></B>
222
<DD> Creates a new text item of at the end of the last line of the compound
223
image. Additional <I>options</I></B> accepted by the text type are:
224
</DL>
225
<UL>
226
<DL>
227
<DT> <B>-background <I>color</I></B>
228
</I></B>
229
<DD> Specifies the background color of the text item.
230
</DL>
231
<DL>
232
<DT> <B>-font <I>name</I></B>
233
</I></B>
234
<DD> Specifies the font to be used for this text item.
235
</DL>
236
<DL>
237
<DT> <B>-foreground <I>color</I></B>
238
</I></B>
239
<DD> Specifies the foreground color of the text item.
240
</DL>
241
<DL>
242
<DT> <B>-justify</B></I> <I>value</I></B>
243
</I></B>
244
<DD> When there are multiple lines of text displayed in a text item, this
245
option determines how the lines line up with each other. <I>value</I></B>
246
must be one of <B>left</B></I>, <B>center</B></I>, or <B>right</B></I>.  <B>Left</B></I>
247
right edges line up.
248
</DL>
249
<DL>
250
<DT> <B>-text <I>string</I></B>
251
</I></B>
252
<DD> Specifies a text string to display in this text item.
253
</DL>
254
<DL>
255
<DT> <B>-underline</B></I> <I>value</I></B>
256
</I></B>
257
<DD> Specifies the integer index of a character to underline in the text
258
item. 0 corresponds to the first character of the text displayed in
259
the text item, 1 to the next character, and so on.
260
</DL>
261
<DL>
262
<DT> <B>-wraplength</B></I> <I>value</I></B>
263
</I></B>
264
<DD> This option specifies the maximum line length of the label string on
265
this text item. If the line length of the label string exceeds this
266
length, it is wrapped onto the next line, so that no line is longer
267
than the specified length. The value may be specified in any of the
268
standard forms for screen distances. If this value is less than or
269
equal to 0 then no wrapping is done: lines will break only at newline
270
characters in the text.
271
</DL>
272
</UL>
273
<DL>
274
<DT> <I>imageName <B>cget</B></I> <I>option</I></B>
275
</I></B>
276
<DD> Returns the current value of the configuration option given by
277
<I>option</I></B>. <I>Option</I></B> may have any of the values accepted by the
278
<B>image create compound</B></I> command.
279
</DL>
280
<DL>
281
<DT> <I>imageName <B>configure</B></I> ?<I>option</I></B>? ?<I>value option value ...</I></B>?
282
</I></B>
283
<DD> Query or modify the configuration options for the image. If no
284
<I>option</I></B> is specified, returns a list describing all of the
285
available options for <I>imageName</I></B> (see <B>Tk_ConfigureInfo</B></I> for
286
information on the format of this list).  If <I>option</I></B> is specified
287
with no <I>value</I></B>, then the command returns a list describing the
288
one named option (this list will be identical to the corresponding
289
sublist of the value returned if no <I>option</I></B> is specified).  If
290
one or more <I>option-value</I></B> pairs are specified, then the command
291
modifies the given option(s) to have the given value(s); in this case
292
the command returns an empty string. <I>Option</I></B> may have any of the
293
values accepted by the <B>image create compound</B></I> command, except the
294
<B>-window</B></I> option
295
</DL>
296
</pre><H3>EXAMPLE</H3>
297
The following example creates a compound image with a bitmap and a
298
text string and places this image into a Tk <B>bitton(n)</B></I>
299
widget. Notice that the image must be created after the creation of
300
the window that it resides in.
301
<pre><code><code><code>
302
 button .b
303
 set img [image create compound -window .b]
304
 $img add line
305
 $img add bitmap -bitmap warning
306
 $img add space -width 8
307
 $img add text -text "Warning" -underline 0
308
 .b config -image $img
309
 pack .b
310
</code></code></code></pre>
311
</pre><H3>KEYWORDS</H3>
312
image(n), Tix(n)
313
<hr><i>Last modified Sun Jan 19 22:34:41 EST 1997 </i> ---
314
<i>Serial 853731307</i>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.