![]() |
ActiveTcl User Guide
|
![]() |
iwidgets::messagebox - Create and manipulate a messagebox text
widget
iwidgets::messagebox pathName ?options?
itk::Widget <- iwidgets::Labeledwidget <-
iwidgets::Scrolledwid- get <- iwidgets::Messagebox
activeBackground activeForeground background borderWidth
options.
labelBitmap labelFont labelImage labelMargin
above associated options.
activeRelief elementBorderWidth
jumptroughColor
associated options.
above associated options.
spacing1 spacing2 spacing3
ciated options.
log when it pops up during a save of the messagebox contents
operation.
the messagebox. When this limit is reached, the oldest line will be deleted such that the total number of lines remains maxlines.
tion dialog pops up during a save of the messagebox contents
operation. If this parameter is not specified, then the files in
the current working directory are displayed.
_________________________________________________________________
messages area widget. Message types can be user defined and con- figured. Their options include foreground, background, font, bell, and their display mode of on or off. This allows message types to defined as needed, removed when no longer so, and modi- fied when necessary. An export method is provided for file I/O. removed. A popup menu which appears when the right mouse button has been pressed in the message area has been predefined. The contents of the popup menu by default support clearing the area and saving its contents to a file. Additional operations may be defined or existing operations removed by using the component command to access the popup menu.
vary with the message type. Types are defined by the user and
they may be added, removed, and configured. The options of the
message type control the display include the following:
-background color
ciated with the message type. It may have any of the forms
accepted by Tk_GetColor.
-bell boolean
this type is issued. Boolean may have any of the forms
accepted by Tk_GetBoolean. The default is 0.
-font fontName
may have any of the forms accepted by Tk_GetFontStruct.
-foreground color
ciated with the message type. It may have any of the forms
accepted by Tk_GetColor.
-show boolean
issued. Boolean may have any of the forms accepted by Tk_Get-
name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?
pathName cget option
option. Option may have any of the values accepted
by the iwid- gets::messagebox command.
pathName clear
pathName export filename
replaced with text widget contents.
pathName configure ?option? ?value
option value ...?
option is specified, returns a list describing all of the
avail- able options for pathName (see
Tk_ConfigureInfo for information on the format of this
list). If option is specified with no value, then the
command returns a list describing the one named option (this list
will be identical to the corresponding sublist of the value
returned if no option is specified). If one or more
option-value pairs are specified, then the command modifies
the given widget option(s) to have the given value(s); in this case
the command returns an empty string. Option may have any of
the values accepted by the iwidgets::messagebox command.
pathName type option msgtype
?arg arg ...?
ior of the command depends on the option argument that follows the type keyword. The following forms of the command are supported:
pathName type add msgtype ?option value ...?
ties defined by the option value pairs. See MESSAGE TYPES for
information on the options that are supported. pathName
type cget msgtype option
ticular configuration option, which must be one of the ones
listed in the section MESSAGE TYPES.
pathName type configure msgtype
?option value ...?
no option is specified, returns a list describing all of
the available options for the message type msgtype. If
option is specified with no value, then the command
returns a list describ- ing the one named option. If one or more
option-value pairs are specified, then the command modifies
the given option(s) to have the given value(s); in this case the
command returns an empty string. See MESSAGE TYPES for information
on the options that are supported. pathName type
remove msgtype Removes an existing message type given
by msgtype.
pathName issue string ?level?
?tags?
additional tags specified.
in the text area of the messagebox. Its contents may be modified
via the component command.
«scrolledtext» widget manual entry for details on the text compo- nent item.
package require Iwidgets 4.0
iwidgets::messagebox .mb -hscrollmode dynamic \ -labeltext
«Messages» -labelpos n \
-height 120 -width 550 -savedir «/tmp» -textbackground
#d9d9d9
pack .mb -padx 5 -pady 5 -fill both -expand yes
.mb type add ERROR -background red -foreground white -bell 1 .mb type add WARNING -background yellow -foreground black .mb type add INFO -background white -foreground black
.mb issue «This is an error message in red with a beep» ERROR .mb issue «This warning message in yellow» WARNING .mb issue «This is an informational message» INFO
messagebox, scrolledtext, text, widget