1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
<manpage cat="cmd" id="dialog" title="dialog" version="0.8">
<!-- This file was automatically generated. DO NOT EDIT (yet)! -->
<!--
Copyright (c) 2005 Joe English
-->
<?TROFF.TH title="dialog" section="n" date="0.8" source="tile" manual="Tile Widget Set" ?>
<namesection>
<name>ttk::dialog</name>
<desc>create a dialog box</desc>
</namesection>
<synopsis>
<syntax>
<b>package require ttk::dialog</b> ?<m>0.8</m>?
<b>ttk::dialog</b> <m>pathname</m> ?<m>options...</m>?
<b>ttk::dialog::define</b> <m>dialogType</m> ?<m>options...</m>?
</syntax>
</synopsis>
<section>
<title>DESCRIPTION</title>
<p>A dialog box is a transient top-level window
containing an icon, a short message, an optional, longer, detail message,
and a row of command buttons.
When the user presses any of the buttons,
a callback function is invoked
and then the dialog is destroyed.
</p>
<p>Additional widgets may be added in the dialog <i>client frame</i>.
</p>
</section>
<section>
<title>OPTIONS</title>
<optionlist>
<optiondef>
<name>-title</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>Specifies a string to use as the window manager title.
</desc>
</optiondef>
<optiondef>
<name>-message</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>Specifies the message to display in this dialog.
</desc>
</optiondef>
<optiondef>
<name>-detail</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>Specifies a longer auxiliary message.
</desc>
</optiondef>
<optiondef>
<name>-command</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>Specifies a command prefix to be invoked when the user presses
one of the command buttons.
The symbolic name of the button is passed as an additional argument
to the command.
The dialog is dismissed after invoking the command.
</desc>
</optiondef>
<optiondef>
<name>-parent</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>Specifies a toplevel window for which the dialog is transient.
If omitted, the default is the nearest ancestor toplevel.
If set to the empty string, the dialog will not be a transient window.
</desc>
</optiondef>
<optiondef>
<name>-type</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>Specifies a built-in or user-defined dialog type.
See <ref refid="predefined-dialog-types">PREDEFINED DIALOG TYPES</ref>, below.
</desc>
</optiondef>
<optiondef>
<name>-icon</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>Specifies one of the stock dialog icons,
<b cat="AMBIGUOUS ambiguous cmd">info</b>, <b>question</b>, <b>warning</b>, <b cat="AMBIGUOUS ambiguous cmd">error</b>,
<b>auth</b>, or <b>busy</b>.
If set to the empty string (the default), no icon is displayed.
</desc>
</optiondef>
<optiondef>
<name>-buttons</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>A list of symbolic button names.
</desc>
</optiondef>
<optiondef>
<name>-labels</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>A dictionary mapping symbolic button names to textual labels.
May be omitted if all the buttons are predefined.
</desc>
</optiondef>
<optiondef>
<name>-default</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>The symbolic name of the default button.
</desc>
</optiondef>
<optiondef>
<name>-cancel</name>
<dbname>n/a</dbname>
<dbclass>n/a</dbclass>
<desc>The symbolic name of the "cancel" button.
The cancel button is invoked if the user presses the Escape key
and when the dialog is closed from the window manager.
If <b>-cancel</b> is not specified,
the dialog ignores window manager close commands (WM_DELETE_WINDOW).
</desc>
</optiondef>
</optionlist>
</section>
<section>
<title>WIDGET COMMANDS</title>
<dl>
<dle>
<dt><b>ttk::dialog::clientframe</b> <m>dlg</m></dt>
<dd>Returns the widget path of the client frame.
Other widgets may be added to the client frame.
The client frame appears between the detail message and the command buttons.
</dd>
</dle>
</dl>
</section>
<section id="predefined-dialog-types">
<title>PREDEFINED DIALOG TYPES</title>
<p>The <b>-type</b> option, if present, specifies default values
for other options. <b>ttk::dialog::define</b> <i>type options...</i>
specifies a new stock dialog <i>type</i>.
The following stock dialog types are predefined:
</p>
<example>
ttk::dialog::define ok \
-icon info -buttons {ok} -default ok
ttk::dialog::define okcancel \
-icon info -buttons {ok cancel} -default ok -cancel cancel
ttk::dialog::define yesno \
-icon question -buttons {yes no}
ttk::dialog::define yesnocancel \
-icon question -buttons {yes no cancel} -cancel cancel
ttk::dialog::define retrycancel \
-icon question -buttons {retry cancel} -cancel cancel
</example>
</section>
<section>
<title>STOCK BUTTONS</title>
<p>The following ``stock'' symbolic button names have predefined labels:
<b>yes</b>, <b>no</b>, <b>ok</b>, <b>cancel</b>, and <b>retry</b>.
</p>
<p>It is not necessary to list these in the <b>-labels</b> dictionary.
</p>
</section>
<section>
<title>EXAMPLE</title>
<example>
proc saveFileComplete {button} {
switch -- $button {
yes { # save file ... }
no { exit }
cancel { # no-op }
}
}
ttk::dialog .saveFileDialog \
-title "Save file?" \
-icon question \
-message "Save file before closing?" \
-detail "If you do not save the file, your work will be lost" \
-buttons [list yes no cancel] \
-labels [list yes "Save file" no "Don't save"] \
-command saveFileComplete \
;
</example>
</section>
<seealso>
<ref>tk_messageBox(n)</ref>
<ref>wm(n)</ref>
<ref>toplevel(n)</ref>
</seealso>
</manpage>
|