The common base class for all dialogs with the user is the Dialog class.
You can use this class to create customized interactions.
For example,
::tycho::Dialog .m -text {A dialog with a customized button}
.m addButton pushme -text {Push Me} -command {::tycho::post thanks}
wm deiconify .m
You can mark the button as a
default button with the following command:
.m default pushme
You can also directly invoke a button from a script using the
invoke method:
.m invoke pushme
.m configure -bitmap questhead
You can also insert an
image
created with the "image create"
command, using the Tk photo widget.
image create photo ptgif -file $TYCHO/kernel/img/tychologo.gif
.m configure -image ptgif
delete object .m
There are two procedures defined in the Dialog class to support
creation of
modal
and non-modal dialog boxes. Each of them takes the
name of a class (which must be derived from Dialog), an instance
name, and optional set of arguments, and creates an instance of the class.
The new procedure creates a non-modal
dialog:
::tycho::Dialog::new Message .y -text \
{This message is automatically mapped}
The Dialog wait
procedure can be used
to map an Dialog object to the screen and then wait for the object to
be destroyed.