Tycho provides a set of ordinary procedures, defined in the tycho namespace, that serve as simplified interfaces to the classes used to create messages for the user and ask the user questions. These are explained here.
Messages and dialog boxes used to interact with users can be either modal or non-modal. A modal dialog is one that prevents the user from performing any other action (within the application) until the dialog has been dismissed. A non-modal dialog is one where the user can perform other functions before dealing with the dialog. Both are useful, and most widgets designed to interact with the user support both.
There are three basic message procedures:
::tycho::inform {This message is created with the inform command}
::tycho::warn {This message is created with the warn command}
tkerror {This message is created with the tkerror command}
You should not use the tkerror procedure directly, except in very rare circumstances. Instead, just call the Tcl command error when you wish to signal an error. See Error Handling.
There are also some non-modal mechanisms for posting messages.
"Non-modal" means that execution continues as soon as the
message is posted. Here is one simple way to provide information
to the user:
::tycho::post {This message is created with the post command}
You can ask the user questions, getting the response back
and taking some action accordingly. The
askuser procedure asks a
yes-no question:
if [::tycho::askuser "Are you awake?"] {
::tycho::inform "You said yes!"
} {
::tycho::inform "Then how did you click on the No button?"
}
::tycho::inform "You entered: [queryinfo {Enter a string}]"
::tycho::inform \
"You entered: [::tycho::queryinfo {Enter a string} {Default} 20]"