1 # ----------------------------------------------------------------------
2 # DEMO: messagebox in [incr Widgets]
3 # ----------------------------------------------------------------------
4 package require Iwidgets 4.0
6 . configure -background white
8 iwidgets::messagebox .mb -hscrollmode dynamic -labeltext "Messages" \
9 -labelpos n -visibleitems 50x8
11 pack .mb -padx 5 -pady 5 -fill both -expand yes
13 .mb type add ERROR -background red -foreground white -bell 1
14 .mb type add WARNING -background yellow -foreground black
15 .mb type add INFO -background white -foreground black
17 frame .cntls -background white
18 pack .cntls -padx 5 -pady 5 -fill x
19 button .cntls.error -text "Error" -command {
20 .mb issue "This is an error message in red with a beep" ERROR
22 pack .cntls.error -side left -expand yes
24 button .cntls.warning -text "Warning" -command {
25 .mb issue "This warning message in yellow" WARNING
27 pack .cntls.warning -side left -expand yes
29 button .cntls.info -text "Info" -command {
30 .mb issue "This is an informational message" INFO
32 pack .cntls.info -side left -expand yes