Manual Pages for UNIX Darwin command on man iwidgets_messagebox
MyWebUniversity

Manual Pages for UNIX Darwin command on man iwidgets_messagebox

iwidgets::messagebox(1) [incr Widgets] iwidgets::messagebox(1)

NAME

iwidgets::messagebox - Create and manipulate a messagebox text widget

SYNOPSIS

iiwwiiddggeettss::::mmeessssaaggeebbooxx pathName ?options? IINNHHEERRIITTAANNCCEE

itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Scrolledwidget <-

iwidgets::Messagebox SSTTAANNDDAARRDD OOPPTTIIOONNSS aaccttiivveeBBaacckkggrroouunndd aaccttiivveeFFoorreeggrroouunndd bbaacckkggrroouunndd bboorrddeerrWWiiddtthh ccuurrssoorr eexxppoorrttSSeelleeccttiioonn ffoonntt ffoorreeggrroouunndd hhiigghhlliigghhttCCoolloorr hhiigghhlliigghhttTThhiicckknneessss ppaaddXX ppaaddYY rreelliieeff sseettGGrriidd See the "options" manual entry for details on the standard options. AASSSSOOCCIIAATTEEDD OOPPTTIIOONNSS llaabbeellBBiittmmaapp llaabbeellFFoonntt llaabbeellIImmaaggee llaabbeellMMaarrggiinn llaabbeellPPooss llaabbeellTTeexxtt llaabbeellVVaarriiaabbllee See the "labeledwidget" class manual entry for details on the above associated options. aaccttiivveeRReelliieeff eelleemmeennttBBoorrddeerrWWiiddtthh jjuummppttrroouugghhCCoolloorr

See the "scrollbar" widget manual entry for details on the above asso-

ciated options. hheeiigghhtt hhssccrroollllMMooddee ssbbWWiiddtthh ssccrroollllMMaarrggiinn tteexxttBBaacckkggrroouunndd vviissiibblleeIItteemmss vvssccrroollllMMooddee wwiiddtthh See the "scrolledtext" widget manual entry for details on the above associated options. ssppaacciinngg11 ssppaacciinngg22 ssppaacciinngg33 See the "text" widget manual entry for details on the above associated options.

WWIIDDGGEETT-SSPPEECCIIFFIICC OOPPTTIIOONNSS

Name: ffiilleeNNaammee Class: FFiilleeNNaammee

Command-Line Switch: -ffiilleennaammee

Specifies the filename to be displayed in the file selection dialog when it pops up during a save of the messagebox contents operation. Name: mmaaxxLLiinneess Class: MMaaxxLLiinneess

Command-Line Switch: -mmaaxxlliinneess

Specifies the maximum number of lines allowed in the text area of the messagebox. When this limit is reached, the oldest line

will be deleted such that the total number of lines remains max-

lines. Name: ssaavveeDDiirr Class: SSaavveeDDiirr

Command-Line Switch: -ssaavveeddiirr

Specifies the default directory to display when the file selec-

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.

DESCRIPTION

The iiwwiiddggeettss::::mmeessssaaggeebbooxx command creates a scrolled information mes-

sages area widget. Message types can be user defined and configured. 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 modified when necessary. An export method is provided for file I/O. The number of lines displayed may be limited with the default being 1000. When this limit is reached, the oldest line is 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. MMEESSSSAAGGEE TTYYPPEESS The display characteristics of messages issued to the messagebox 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 con-

trol the display include the following:

-bbaacckkggrroouunndd color

Color specifies the background color to use for characters asso-

ciated with the message type. It may have any of the forms accepted by TTkkGGeettCCoolloorr.

-bbeellll boolean

Specifies whether or not to ring the bell whenenver a message of this type is issued. Boolean may have any of the forms accepted by TTkkGGeettBBoooolleeaann. The default is 0.

-ffoonntt fontName

FontName is the name of a font to use for drawing characters. It may have any of the forms accepted by TkGetFontStruct.

-ffoorreeggrroouunndd color

Color specifies the foreground color to use for characters asso-

ciated with the message type. It may have any of the forms accepted by TTkkGGeettCCoolloorr.

-sshhooww boolean

Specifies whether of not to display this message type when

issued. Boolean may have any of the forms accepted by TTkkGGeett-

BBoooolleeaann. The default is 1. MMEETTHHOODDSS The iiwwiiddggeettss::::mmeessssaaggeebbooxx command creates a new Tcl command whose 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 ...? Option and the args determine the exact behavior of the command. The following commands are possible for messagebox widgets:

WWIIDDGGEETT-SSPPEECCIIFFIICC MMEETTHHOODDSS

pathName ccggeett option Returns the current value of the configuration option given by

option. Option may have any of the values accepted by the iiwwiidd-

ggeettss::::mmeessssaaggeebbooxx command. pathName cclleeaarr Clear the messagebox of all messages. pathName eexxppoorrtt filename Write text to a file. If filename exists then contents are replaced with text widget contents. pathName ccoonnffiigguurree ?option? ?value option value ...? Query or modify the configuration options of the widget. If no

option is specified, returns a list describing all of the avail-

able options for pathName (see TTkkCCoonnffiigguurreeIInnffoo 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 iiwwiiddggeettss::::mmeessssaaggeebbooxx command. pathName ttyyppee option msgtype ?arg arg ...?

This command is used to manipulate message types. The behav-

ior of the command depends on the option argument that follows

the type keyword. The following forms of the command are sup-

ported: pathName ttyyppee aadddd msgtype ?option value ...? Adds a new message type given by msgtype with the display properties defined by the option value pairs. See MESSAGE TYPES for

information on the options that are sup-

ported. pathName ttyyppee ccggeett msgtype option Returns the value of a configuration option for a message type. Msgtype identifies the

message type, and option specifies a par-

ticular configuration option, which must be

one of the ones listed in the section MES-

SAGE TYPES. pathName ttyyppee ccoonnffiigguurree msgtype ?option value ...? Query or modify the configuration options

for a message type. If no option is speci-

fied, returns a list describing all of the

available options for the message type msg-

type. If option is specified with no value, then the command returns a list describing 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 MES-

SAGE TYPES for information on the options that are supported. pathName ttyyppee rreemmoovvee msgtype Removes an existing message type given by msgtype. pathName iissssuuee string ?level? ?tags? Print a string to the text area at the given level and with any additional tags specified. CCOOMMPPOONNEENNTTSS Name: iitteemmMMeennuu Class: MMeennuu This is the popup menu that gets displayed when

you right-click in the text area of the message-

box. Its contents may be modified via the compo-

nent command. Name: tteexxtt Class: SSccrroolllleeddtteexxtt The text component is the scrolledtext widget. See the "scrolledtext" widget manual entry for details on the text component item. EEXXAAMMPPLLEE 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 AUTHOR Alfredo Jahn V Mark L. Ulferts KKEEYYWWOORRDDSS messagebox, scrolledtext, text, widget Tk iwidgets::messagebox(1)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™