Version 28 of dialog

Updated 2014-11-12 20:07:16 by dkf

A dialog window is usually shown from an application as a temporary display to show information or to query the user. As the Tk toplevel command is a general purpose command for creating application windows there are a few things that should be set to make a dialog look standard.

Most window managers handle dialog windows differently to application windows. For instance a dialog may not show up in the taskbar and may have different frame decorations (the buttons on the outside edge) and even different animations when being mapped and unmapped. This is usually handled by setting the dialog toplevel to be transient with regards to the parent or owner window. This is often sufficient but on modern X11 systems if might also be helpful to set the toplevel type to dialog as well (Tk 8.6):

set dialog [toplevel $parent -class Dialog]
wm transient $dialog $owner
catch {wm attributes $dialog -type dialog}

Note that if you need a messagebox then you should use tk_messageBox which will use the native messagebox dialogs on windows and MacOSX.

For quick and dirty (and ugly) general purpose dialogs see the tk_dialog command.

There are some built-in dialogs which may defer to system native equivalents where available. See:


http://incrtcl.sourceforge.net/iwidgets/iwidgets/dialog.gif

incr Widgets also has a dialog command - see the docs at http://incrtcl.sourceforge.net/iwidgets/iwidgets/dialog.html and http://purl.org/tcl/home/man/iwidgets3.0/dialog.n.html .


LV When using wish, there are at times errors reported in what I presume are dialog boxes. When these boxes appear, the user is unable to copy and paste the information about the error into another file. Is there anything which a developer can do in these cases to make the error reporting better?


See also

See also the dialog in the tklib widget package. [L2 ]


bugant tk-goodies provides a nice dialogs package and they look more cleaner and beauty than the tk_dialog ones. For more info, screenshot and download visit tk-goodies website [L3 ]

http://tk-goodies.berlios.de/img/info.png