Displaying a confirmation dialog
The tk_dialog
command displays a modal message window and awaits the user's response. The value returned provides the index of the button selected: 0 for the leftmost; with the value increasing by 1 for each additional button. If the dialog is destroyed prior to the user making a selection, the return value is -1. All arguments must be provided.
The syntax is as follows:
tk_dialog window title text bitmap default string…
Option |
Interpretation |
---|---|
window |
Name to assign to the dialog (for example |
title |
Sets the text to be displayed in the dialog title bar. |
text |
Sets the message to be displayed |
bitmap |
Sets the bitmap (icon) to be displayed in the top of the dialog to the left of the text. If an empty string is passed no bitmap will be displayed. |
default |
Designates which button is default. This may have an effect on the visual appearance of the buttons and can also be tied to the <return> key. |
string |
Sets the text to display... |