The dialog procedures that post messages for the user are based on Itcl classes described below. These classes can also be invoked directly by the user, providing much more flexibility. They also serve as base classes for more elaborate dialogs.
Many messages require an OK
button that has the effect of
dismissing the message. The Message class is derived from Dialog and adds this feature.
::tycho::Message .x -text {A simple message window}
wm deiconify .x
addButton
method
(if you already pressed the close button, you will need to
double-click on the above code again!):
.x addButton pushme -text {Push Me} -command {::tycho::post thanks}
The class ErrorMessage is derived from
Message and simply adds the
"Stack Trace
" button.
::tycho::ErrorMessage .xx -text {An error message}
wm deiconify .xx
ErrorMessage
class. Use error
instead
(see Error Handling).