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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [man/] [compound.n] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
'\"
2
'\" Copyright (c) 1996, Expert Interface Technologies
3
'\"
4
'\" See the file "license.terms" for information on usage and redistribution
5
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6
'\"
7
'\" The file man.macros and some of the macros used by this file are
8
'\" copyrighted: (c) 1990 The Regents of the University of California.
9
'\"              (c) 1994-1995 Sun Microsystems, Inc.
10
'\" The license terms of the Tcl/Tk distrobution are in the file
11
'\" license.tcl.
12
.so man.macros
13
.HS compound tix 4.0
14
.BS
15
.SH NAME
16
Compound \- Create multi-line compound images.
17
.SH SYNOPSIS
18
\fBimage create compound \fR?\fIname\fR? ?\fIoptions\fR?
19
.BE
20
'
21
.SH DESCRIPTION
22
.PP
23
'
24
Compound image types can be used to create images that consists of
25
multiple horizontal lines; each line is composed of a series of items
26
(texts, bitmaps, images or spaces) arranged from left to
27
right. Compound images are mainly used to embed complex drawings into
28
widgets that support the \fB\-image\fR option. As shown in the EXAMPLE
29
section below, a compound image can be used to display a bitmap and a
30
text string simutaneously in a TK \fBbutton(n)\fR widget.
31
'
32
.SH "CREATING COMPOUND IMAGES"
33
.PP
34
Like all images, compound images are created using the \fBimage create\fR
35
command. Compound images support the following \fIoptions\fR:
36
.TP
37
\fB\-background \fIcolor\fR
38
'
39
Specifies the background color of the compound image. This color is
40
also used as the default background color for the bitmap items in the
41
compound image.
42
'
43
.TP
44
\fB\-borderwidth \fIpixels\fR
45
'
46
Specifies a non-negative value indicating the width of the 3-D border
47
drawn around the compound image.
48
'
49
.TP
50
\fB\-font \fIfont\fR
51
'
52
Specifies the default font for the text items in the compound image.
53
'
54
.TP
55
\fB\-foreground \fIcolor\fR
56
'
57
Specifies the default foreground color for the bitmap and text items
58
in the compound image.
59
'
60
.TP
61
\fB\-padx \fIvalue\fR
62
'
63
Specifies a non-negative value indicating how much extra space to
64
request for the compound image in the X-direction. The \fIvalue\fR may
65
have any of the forms acceptable to \fBTk_GetPixels(3)\fR.
66
'
67
.TP
68
\fB\-pady \fIvalue\fR
69
'
70
Specifies a non-negative value indicating how much extra space to
71
request for the compound image in the Y-direction.
72
.TP
73
\fB\-relief \fIvalue\fR
74
'
75
Specifies the 3-D effect desired for the background of the compound
76
image. Acceptable values are \fBraised\fR, \fBsunken\fR, \fBflat\fR,
77
\fBridge\fR, and \fBgroove\fR.
78
'
79
.TP
80
\fB\-showbackground \fIvalue\fR
81
'
82
Specifies whether the background and the 3D borders should be drawn.
83
Must be a valid boolean value. By default the background is not drawn
84
and the compound image appears to have a transparent background.
85
'
86
.TP
87
\fB\-window \fIpathName\fR
88
'
89
Specifies the window in which the compound image is displayed. One
90
compound image can be displayed in only one window. When that window
91
is destroyed, the compound image is automatically destroyed as well.
92
This option must be specified when calling the \fBimage create
93
compound\fR command and cannot be changed by the \fBconfigure\fR image
94
command.
95
'
96
.SH "IMAGE COMMAND"
97
.PP
98
When a compound image is created, Tk also creates a new command whose
99
name is the same as the image. This command may be used to invoke
100
various operations on the image. It has the following general form:
101
.DS C
102
\fIimageName option \fR?\fIarg arg ...\fR?
103
.DE
104
\fIOption\fR and the \fIarg\fRs
105
'
106
determine the exact behavior of the command. The following
107
commands are possible for compound images:
108
'
109
'
110
.TP
111
\fIimageName \fBadd line\fR ?\fIoption value ...\fR?
112
'
113
Creates a new line at the bottom of the compound image. Lines support
114
the following \fIoptions\fR:
115
.RS
116
.TP
117
\fB\-anchor\fR value
118
'
119
Specifies how the line should be aligned along the horizontal axis.
120
When the values are \fBw\fR, \fBsw\fR or \fBnw\fR, the line is aligned
121
to the left. When the values are \fBc\fR, \fBs\fR or \fBn\fR, the line
122
is aligned to the middle.  When the values are \fBe\fR, \fBse\fR or
123
\fBne\fR, the line is aligned to the right.
124
'
125
.TP
126
\fB\-padx \fIvalue\fR
127
'
128
Specifies a non-negative value indicating how much extra space to
129
request for this line in the X-direction.
130
.RE
131
'
132
.TP
133
\fIimageName \fBadd \fIitem-type\fR ?\fIoption value ...\fR?
134
'
135
Creates a new item of the type \fIitem-type\fR at the end of the last
136
line of the compound image. All types of items support
137
these following common \fIoptions\fR:
138
.RS
139
.TP
140
\fB-anchor\fR value
141
'
142
Specifies how the item should be aligned along the vertical axis. When
143
the values are \fBn\fR, \fBnw\fR or \fBne\fR, the item is aligned to
144
the top of the line. When the values are \fBc\fR, \fBw\fR or \fBe\fR,
145
the item is aligned to the middle of the line.  When the values are
146
\fBs\fR, \fBse\fR or \fBsw\fR, the item is aligned to the bottom of
147
the line.
148
'
149
.TP
150
\fB\-padx \fIvalue\fR
151
'
152
Specifies a non-negative value indicating how much extra space to
153
request for this item in the X-direction.
154
'
155
.TP
156
\fB\-pady \fIvalue\fR
157
'
158
Specifies a non-negative value indicating how much extra space to
159
request for this item in the Y-direction.
160
'
161
.TP
162
\fIitem-type\fR can be any of the following:
163
.RE
164
'
165
'----------------------------------------
166
.TP
167
\fIimageName \fBadd bitmap\fR ?\fIoption value ...\fR?
168
'
169
Creates a new bitmap item of at the end of the last
170
line of the compound image. Additional \fIoptions\fR accepted by the
171
bitmap type are:
172
'
173
.RS
174
.TP
175
\fB\-background \fIcolor\fR
176
'
177
Specifies the background color of the bitmap item.
178
'
179
'
180
.TP
181
\fB\-bitmap \fIname\fR
182
'
183
Specifies a bitmap to display in this item, in any of the forms
184
acceptable to \fBTk_GetBitmap(3)\fR.
185
'
186
.TP
187
\fB\-foreground \fIcolor\fR
188
'
189
Specifies the foreground color of the bitmap item.
190
'
191
.RE
192
'----------------------------------------
193
.TP
194
\fIimageName \fBadd image\fR ?\fIoption value ...\fR?
195
'
196
Creates a new image item of at the end of the last
197
line of the compound image. Additional \fIoptions\fR accepted by the
198
image type are:
199
'
200
.RS
201
.TP
202
'
203
.TP
204
\fB\-image \fIname\fR
205
'
206
Specifies an image to display in this item. \fIname\fR
207
must have been created with the \fBimage create\fR command.
208
'
209
.RE
210
'----------------------------------------
211
.TP
212
\fIimageName \fBadd space\fR ?\fIoption value ...\fR?
213
'
214
Creates a new space item of at the end of the last line of the
215
compound image. Space items do not display anything. They just acts as
216
space holders that add additional spaces between items inside a
217
compound image. Additional \fIoptions\fR accepted by the image type
218
are:
219
'
220
.RS
221
.TP
222
'
223
.TP
224
\fB\-width \fIvalue\fR
225
'
226
Specifies the width of this space. The \fIvalue\fR may have any of the
227
forms acceptable to \fBTk_GetPixels(3)\fR.
228
'
229
.TP
230
\fB\-height \fIvalue\fR
231
'
232
Specifies the height of this space. The \fIvalue\fR may have any of
233
the forms acceptable to \fBTk_GetPixels(3)\fR.
234
'
235
.RE
236
'----------------------------------------
237
.TP
238
\fIimageName \fBadd text\fR ?\fIoption value ...\fR?
239
'
240
Creates a new text item of at the end of the last line of the compound
241
image. Additional \fIoptions\fR accepted by the text type are:
242
'
243
.RS
244
.TP
245
\fB\-background \fIcolor\fR
246
'
247
Specifies the background color of the text item.
248
'
249
.TP
250
\fB\-font \fIname\fR
251
'
252
Specifies the font to be used for this text item.
253
'
254
.TP
255
\fB\-foreground \fIcolor\fR
256
'
257
Specifies the foreground color of the text item.
258
'
259
.TP
260
\fB\-justify\fR \fIvalue\fR
261
'
262
When there are multiple lines of text displayed in a text item, this
263
option determines how the lines line up with each other. \fIvalue\fR
264
must be one of \fBleft\fR, \fBcenter\fR, or \fBright\fR.  \fBLeft\fR
265
means that the lines' left edges all line up, \fBcenter\fR means that
266
the lines' centers are aligned, and \fBright\fR means that the lines'
267
right edges line up.
268
'
269
.TP
270
\fB\-text \fIstring\fR
271
'
272
Specifies a text string to display in this text item.
273
'
274
.TP
275
\fB\-underline\fR \fIvalue\fR
276
'
277
Specifies the integer index of a character to underline in the text
278
item. 0 corresponds to the first character of the text displayed in
279
the text item, 1 to the next character, and so on.
280
'
281
.TP
282
\fB\-wraplength\fR \fIvalue\fR
283
'
284
This option specifies the maximum line length of the label string on
285
this text item. If the line length of the label string exceeds this
286
length, it is wrapped onto the next line, so that no line is longer
287
than the specified length. The value may be specified in any of the
288
standard forms for screen distances. If this value is less than or
289
equal to 0 then no wrapping is done: lines will break only at newline
290
characters in the text.
291
'
292
.RE
293
'----------------------------------------
294
'
295
.TP
296
\fIimageName \fBcget\fR \fIoption\fR
297
'
298
Returns the current value of the configuration option given by
299
\fIoption\fR. \fIOption\fR may have any of the values accepted by the
300
\fBimage create compound\fR command.
301
'
302
.TP
303
\fIimageName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
304
'
305
Query or modify the configuration options for the image. If no
306
\fIoption\fR is specified, returns a list describing all of the
307
available options for \fIimageName\fR (see \fBTk_ConfigureInfo\fR for
308
information on the format of this list).  If \fIoption\fR is specified
309
with no \fIvalue\fR, then the command returns a list describing the
310
one named option (this list will be identical to the corresponding
311
sublist of the value returned if no \fIoption\fR is specified).  If
312
one or more \fIoption\-value\fR pairs are specified, then the command
313
modifies the given option(s) to have the given value(s); in this case
314
the command returns an empty string. \fIOption\fR may have any of the
315
values accepted by the \fBimage create compound\fR command, except the
316
\fB\-window\fR option
317
'.
318
'----------------------------------------
319
'
320
.SH EXAMPLE
321
'
322
The following example creates a compound image with a bitmap and a
323
text string and places this image into a Tk \fBbitton(n)\fR
324
widget. Notice that the image must be created after the creation of
325
the window that it resides in.
326
'
327
.nf
328
 button .b
329
 set img [image create compound -window .b]
330
 $img add line
331
 $img add bitmap -bitmap warning
332
 $img add space -width 8
333
 $img add text -text "Warning" -underline 0
334
 .b config -image $img
335
 pack .b
336
.fi
337
'
338
.SH KEYWORDS
339
image(n), Tix(n)

powered by: WebSVN 2.1.0

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