This is a [incr tcl] version of the OSF/Motif MessageBox widget with bitmaps for the message types. The class requires the BLT extension. The file name is MessageBox.itcl. ----------------------------- Cut Here --------------------------------- # # MessageBox # ---------------------------------------------------------------------- # Implements a version of the OSF/Motif standard message dialog box # complete with the associated bitmaps for each type of message. # # # PUBLIC ATTRIBUTES: # # -title .............. window title text, default "Message Dialog" # -type ............... Type of message dialog, error, information, # ............... message (default), question, warning, and # ............... working. # -message ............ Proper list of messages to be displayed. # -dispCancel ......... Display the cancel button, default yes. # -defaultBtn ......... Default button, ok or cancel, default ok. # -okLabel ............ Label string for ok button, default "OK". # -cancelLabel ........ Label string for cancel button, default "Cancel". # # METHODS: # # config ......... Used to change public attributes. # activate ....... Perform a grab, upon selection of ok(1) or cancel(0), # return result. # # NOTES: # # This widget requires the BLT toolkit for bitmap support. # # USAGE: # # MessageBox .cf1 -title "Error" -message {"You screwed up" "Again !"} \ # -type error -dispCancel 0 # if {[.cf1 activate]} { # puts stdout "OK" # } else { # puts stdout "Cancel" # } # # MessageBox .cf2 -title "Question" -message [list "Are you sure ?"] \ # -type question -defaultBtn cancel -okLabel Yes -cancelLabel No # if {[.cf2 activate]} { # .cf2 config -message {"Are you really sure ?"} # if {[.cf2 activate]} { # puts stdout "Yes" # } else { # puts stdout "No" # } # } else { # puts stdout "No" # } # # .cf1 delete # .cf2 delete # # X11 OPTION DATABASE ATTRIBUTES # # ...and the rest of the usual widget attributes # # ---------------------------------------------------------------------- # AUTHOR: Mark L. Ulferts Phone: (214) 519-3947 # DSC Communications Corp E-mail: mulferts@spd.dsccc.com # ----------------------------------------------------------------------