1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1995 DSC Technologies Corporation
|
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 |
|
|
'\" @(#) scrolledtext.n 1.21 94/12/17 16:04:44
|
8 |
|
|
'/"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.HS messagebox iwid
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
messagebox \- Create and manipulate a messagebox text widget
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBmessagebox\fI \fIpathName \fR?\fIoptions\fR?
|
17 |
|
|
.SH "INHERITANCE"
|
18 |
|
|
itk::Widget <- Labeledwidget <- Scrolledwidget <- Messagebox
|
19 |
|
|
.SH "STANDARD OPTIONS"
|
20 |
|
|
.LP
|
21 |
|
|
.nf
|
22 |
|
|
.ta 4c 8c 12c
|
23 |
|
|
\fBactiveBackground\fR \fBactiveForeground\fR \fBbackground\fR \fBborderWidth\fR
|
24 |
|
|
\fBcursor\fR \fBexportSelection\fR \fBfont\fR \fBforeground\fR
|
25 |
|
|
\fBhighlightColor\fR \fBhighlightThickness\fR \fBpadX\fR \fBpadY\fR
|
26 |
|
|
\fBrelief\fR \fBsetGrid\fR
|
27 |
|
|
.fi
|
28 |
|
|
.LP
|
29 |
|
|
See the "options" manual entry for details on the standard options.
|
30 |
|
|
.SH "ASSOCIATED OPTIONS"
|
31 |
|
|
.LP
|
32 |
|
|
.nf
|
33 |
|
|
.ta 4c 8c 12c
|
34 |
|
|
\fBlabelBitmap\fR \fBlabelFont\fR \fBlabelImage\fR \fBlabelMargin\fR
|
35 |
|
|
\fBlabelPos\fR \fBlabelText\fR \fBlabelVariable\fR
|
36 |
|
|
.fi
|
37 |
|
|
.LP
|
38 |
|
|
See the "labeledwidget" class manual entry for details on the above
|
39 |
|
|
associated options.
|
40 |
|
|
.LP
|
41 |
|
|
.nf
|
42 |
|
|
.ta 4c 8c 12c
|
43 |
|
|
\fBactiveRelief\fR \fBelementBorderWidth\fR \fBjump\fR \fBtroughColor\fR
|
44 |
|
|
.fi
|
45 |
|
|
.LP
|
46 |
|
|
See the "scrollbar" widget manual entry for details on the above
|
47 |
|
|
associated options.
|
48 |
|
|
.LP
|
49 |
|
|
.nf
|
50 |
|
|
.ta 4c 8c 12c
|
51 |
|
|
\fBheight\fR \fBhscrollMode\fR \fBsbWidth\fR \fBscrollMargin\fR
|
52 |
|
|
\fBtextBackground\fR \fBvisibleItems\fR \fBvscrollMode\fR \fBwidth\fR
|
53 |
|
|
.fi
|
54 |
|
|
.LP
|
55 |
|
|
See the "scrolledtext" widget manual entry for details on the above
|
56 |
|
|
associated options.
|
57 |
|
|
.LP
|
58 |
|
|
.nf
|
59 |
|
|
.ta 4c 8c 12c
|
60 |
|
|
\fBspacing1\fR \fBspacing2\fR \fBspacing3\fR
|
61 |
|
|
.fi
|
62 |
|
|
.LP
|
63 |
|
|
See the "text" widget manual entry for details on the above
|
64 |
|
|
associated options.
|
65 |
|
|
|
66 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
67 |
|
|
.LP
|
68 |
|
|
.nf
|
69 |
|
|
Name: \fBfileName\fR
|
70 |
|
|
Class: \fBFileName\fR
|
71 |
|
|
Command-Line Switch: \fB-filename\fR
|
72 |
|
|
.fi
|
73 |
|
|
.IP
|
74 |
|
|
Specifies the filename to be displayed in the file selection dialog when
|
75 |
|
|
it pops up during a save of the messagebox contents operation.
|
76 |
|
|
.LP
|
77 |
|
|
.nf
|
78 |
|
|
Name: \fBmaxLines\fR
|
79 |
|
|
Class: \fBMaxLines\fR
|
80 |
|
|
Command-Line Switch: \fB-maxlines\fR
|
81 |
|
|
.fi
|
82 |
|
|
.IP
|
83 |
|
|
Specifies the maximum number of lines allowed in the text area of the
|
84 |
|
|
messagebox. When this limit is reached, the oldest line will be deleted
|
85 |
|
|
such that the total number of lines remains \fImaxlines\fR.
|
86 |
|
|
.LP
|
87 |
|
|
.nf
|
88 |
|
|
Name: \fBsaveDir\fR
|
89 |
|
|
Class: \fBSaveDir\fR
|
90 |
|
|
Command-Line Switch: \fB-savedir\fR
|
91 |
|
|
.fi
|
92 |
|
|
.IP
|
93 |
|
|
Specifies the default directory to display when the file selection dialog
|
94 |
|
|
pops up during a save of the messagebox contents operation. If this
|
95 |
|
|
parameter is not specified, then the files in the current working directory
|
96 |
|
|
are displayed.
|
97 |
|
|
.LP
|
98 |
|
|
.BE
|
99 |
|
|
|
100 |
|
|
.SH DESCRIPTION
|
101 |
|
|
.PP
|
102 |
|
|
The \fBmessagebox\fR command creates
|
103 |
|
|
a scrolled information messages area widget.
|
104 |
|
|
Message types can be user defined and configured. Their options
|
105 |
|
|
include foreground, background, font, bell, and their display
|
106 |
|
|
mode of on or off. This allows message types to defined as needed,
|
107 |
|
|
removed when no longer so, and modified when necessary. An export
|
108 |
|
|
method is provided for file I/O.
|
109 |
|
|
|
110 |
|
|
.PP
|
111 |
|
|
The number of lines displayed may be limited with
|
112 |
|
|
the default being 1000. When this limit is reached, the oldest line
|
113 |
|
|
is removed. A popup menu which appears when the right mouse button
|
114 |
|
|
has been pressed in the message area has been predefined. The contents
|
115 |
|
|
of the popup menu by default support clearing the area and saving its
|
116 |
|
|
contents to a file. Additional operations may be defined or existing
|
117 |
|
|
operations removed by using the component command to access the
|
118 |
|
|
popup menu.
|
119 |
|
|
|
120 |
|
|
.SH "MESSAGE TYPES"
|
121 |
|
|
.PP
|
122 |
|
|
The display characteristics of messages issued to the messagebox vary
|
123 |
|
|
with the message type. Types are defined by the user and they may
|
124 |
|
|
be added, removed, and configured. The options of the message type
|
125 |
|
|
control the display include the following:
|
126 |
|
|
.TP
|
127 |
|
|
\fB\-background \fIcolor\fR
|
128 |
|
|
\fIColor\fR specifies the background color to use for characters
|
129 |
|
|
associated with the message type.
|
130 |
|
|
It may have any of the forms accepted by \fBTk_GetColor\fR.
|
131 |
|
|
.TP
|
132 |
|
|
\fB\-bell \fIboolean\fR
|
133 |
|
|
Specifies whether or not to ring the bell whenenver a message of this
|
134 |
|
|
type is issued. \fIBoolean\fR may have any of the forms accepted by
|
135 |
|
|
\fBTk_GetBoolean\fR. The default is 0.
|
136 |
|
|
.TP
|
137 |
|
|
\fB-font\ \fIfontName\fR
|
138 |
|
|
\fIFontName\fR is the name of a font to use for drawing
|
139 |
|
|
characters. It may have any of the forms accepted
|
140 |
|
|
by Tk_GetFontStruct.
|
141 |
|
|
.TP
|
142 |
|
|
\fB\-foreground \fIcolor\fR
|
143 |
|
|
\fIColor\fR specifies the foreground color to use for characters
|
144 |
|
|
associated with the message type.
|
145 |
|
|
It may have any of the forms accepted by \fBTk_GetColor\fR.
|
146 |
|
|
.TP
|
147 |
|
|
\fB\-show \fIboolean\fR
|
148 |
|
|
Specifies whether of not to display this message type when issued.
|
149 |
|
|
\fIBoolean\fR may have any of the forms accepted by
|
150 |
|
|
\fBTk_GetBoolean\fR. The default is 1.
|
151 |
|
|
|
152 |
|
|
.SH "METHODS"
|
153 |
|
|
.PP
|
154 |
|
|
The \fBmessagebox\fR command creates a new Tcl command whose
|
155 |
|
|
name is \fIpathName\fR. This
|
156 |
|
|
command may be used to invoke various
|
157 |
|
|
operations on the widget. It has the following general form:
|
158 |
|
|
.DS C
|
159 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
160 |
|
|
.DE
|
161 |
|
|
\fIOption\fR and the \fIarg\fRs
|
162 |
|
|
determine the exact behavior of the command. The following
|
163 |
|
|
commands are possible for messagebox widgets:
|
164 |
|
|
|
165 |
|
|
.SH "WIDGET-SPECIFIC METHODS"
|
166 |
|
|
.TP
|
167 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
168 |
|
|
Returns the current value of the configuration option given
|
169 |
|
|
by \fIoption\fR.
|
170 |
|
|
\fIOption\fR may have any of the values accepted by the \fBmessagebox\fR
|
171 |
|
|
command.
|
172 |
|
|
.TP
|
173 |
|
|
\fIpathName \fBclear\fR
|
174 |
|
|
Clear the messagebox of all messages.
|
175 |
|
|
.TP
|
176 |
|
|
\fIpathName \fBexport\fR \fIfilename\fR
|
177 |
|
|
Write text to a file. If \fIfilename\fR exists then
|
178 |
|
|
contents are replaced with text widget contents.
|
179 |
|
|
.TP
|
180 |
|
|
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
181 |
|
|
Query or modify the configuration options of the widget.
|
182 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
183 |
|
|
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
184 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
185 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
186 |
|
|
one named option (this list will be identical to the corresponding
|
187 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
188 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
189 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
190 |
|
|
this case the command returns an empty string.
|
191 |
|
|
\fIOption\fR may have any of the values accepted by the \fBmessagebox\fR
|
192 |
|
|
command.
|
193 |
|
|
.TP
|
194 |
|
|
\fIpathName \fBtype\fR \fIoption\fR \fImsgtype\fR ?\fIarg arg ...\fR?
|
195 |
|
|
This command is used to manipulate message types. The behavior of
|
196 |
|
|
the command depends on the option argument that follows the type keyword.
|
197 |
|
|
The following forms of the command are supported:
|
198 |
|
|
.RS
|
199 |
|
|
.TP
|
200 |
|
|
.TP
|
201 |
|
|
\fIpathName \fBtype add\fR \fImsgtype\fR ?\fIoption value ...\fR?
|
202 |
|
|
Adds a new message type given by \fImsgtype\fR with the display
|
203 |
|
|
properties defined by the option value pairs.
|
204 |
|
|
See MESSAGE TYPES for information on the options that
|
205 |
|
|
are supported.
|
206 |
|
|
.TP
|
207 |
|
|
\fIpathName \fBtype cget\fR \fImsgtype option\fR
|
208 |
|
|
Returns the value of a configuration option for a message type.
|
209 |
|
|
\fIMsgtype\fR identifies the message type, and \fIoption\fR
|
210 |
|
|
specifies a particular configuration option, which must be one of
|
211 |
|
|
the ones listed in the section MESSAGE TYPES.
|
212 |
|
|
.TP
|
213 |
|
|
\fIpathName \fBtype configure \fImsgtype\fR ?\fIoption value ...\fR?
|
214 |
|
|
Query or modify the configuration options for a message type.
|
215 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
216 |
|
|
the available options for the message type \fImsgtype\fR.
|
217 |
|
|
If \fIoption\fR is specified with no \fIvalue\fR, then the command
|
218 |
|
|
returns a list describing the one named option.
|
219 |
|
|
If one or more \fIoption\-value\fR pairs are specified, then the command
|
220 |
|
|
modifies the given option(s) to have the given value(s); in
|
221 |
|
|
this case the command returns an empty string.
|
222 |
|
|
See MESSAGE TYPES for information on the options that
|
223 |
|
|
are supported.
|
224 |
|
|
\fIpathName \fBtype remove\fR \fImsgtype\fR
|
225 |
|
|
Removes an existing message type given by \fImsgtype\fR.
|
226 |
|
|
.RE
|
227 |
|
|
.TP
|
228 |
|
|
\fIpathName \fBissue\fR \fIstring\fR \fI?level?\fR \fI?tags?\fR
|
229 |
|
|
Print a \fIstring\fR to the text area at the given level and with
|
230 |
|
|
any additional tags specified.
|
231 |
|
|
|
232 |
|
|
.SH "COMPONENTS"
|
233 |
|
|
.LP
|
234 |
|
|
.nf
|
235 |
|
|
Name: \fBitemMenu\fR
|
236 |
|
|
Class: \fBMenu\fR
|
237 |
|
|
.fi
|
238 |
|
|
.IP
|
239 |
|
|
This is the popup menu that gets displayed when you right-click in the
|
240 |
|
|
text area of the messagebox. Its contents may be modified via the component
|
241 |
|
|
command.
|
242 |
|
|
.LP
|
243 |
|
|
.nf
|
244 |
|
|
Name: \fBtext\fR
|
245 |
|
|
Class: \fBScrolledtext\fR
|
246 |
|
|
.fi
|
247 |
|
|
.IP
|
248 |
|
|
The text component is the scrolledtext widget. See the "scrolledtext" widget
|
249 |
|
|
manual entry for details on the text component item.
|
250 |
|
|
.fi
|
251 |
|
|
|
252 |
|
|
.SH EXAMPLE
|
253 |
|
|
.DS
|
254 |
|
|
messagebox .mb -hscrollmode dynamic -labeltext "Messages" -labelpos n \\
|
255 |
|
|
-height 120 -width 550 -savedir "/tmp" -textbackground #d9d9d9
|
256 |
|
|
|
257 |
|
|
pack .mb -padx 5 -pady 5 -fill both -expand yes
|
258 |
|
|
|
259 |
|
|
.mb type add ERROR -background red -foreground white -bell 1
|
260 |
|
|
.mb type add WARNING -background yellow -foreground black
|
261 |
|
|
.mb type add INFO -background white -foreground black
|
262 |
|
|
|
263 |
|
|
.mb issue "This is an error message in red with a beep" ERROR
|
264 |
|
|
.mb issue "This warning message in yellow" WARNING
|
265 |
|
|
.mb issue "This is an informational message" INFO
|
266 |
|
|
.DE
|
267 |
|
|
.SH AUTHOR
|
268 |
|
|
Alfredo Jahn V
|
269 |
|
|
.DE
|
270 |
|
|
Mark L. Ulferts
|
271 |
|
|
.LP
|
272 |
|
|
.SH KEYWORDS
|
273 |
|
|
messagebox, scrolledtext, text, widget
|
274 |
|
|
|