Wiki Markup |
---|
{alias:qwarning}
h2. Name
*qwarning* — information dialog displaying a warning
h2. Syntax
{panel:|borderStyle=solid|borderWidth=1|bgColor=#FFFFAA}
*qwarning* _caption text_ \[_ |
Name
qwarning — information dialog displaying a warning
Syntax
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
qwarning caption text [button-0-text _] \[ _button-1-text _] \[ _button-2-text _] {panel} h2. Description The *qwarning* command displays a] |
Description
The qwarning command displays a read-only
...
warning
...
dialog
...
with
...
one
...
or
...
more
...
buttons,
...
along
...
with
...
a
...
caption.
...
The
...
default
...
is
...
a
...
single
...
'OK'
...
button.
...
The
...
dialog
...
is
...
modal
...
,
...
therefore
...
execution
...
is
...
halted
...
until
...
the
...
user
...
closes
...
the
...
dialog.
...
The
...
dialog
...
may
...
optionally
...
have
...
up
...
to
...
three
...
buttons
...
to
...
replace
...
the
...
default
...
OK
...
button.
...
The
...
buttons
...
are
...
implicitly
...
numbered
...
0,
...
1,
...
2.
...
The
...
command
...
will
...
return
...
the
...
number
...
corresponding
...
to
...
the
...
button
...
pressed
...
by
...
the
...
user.
...
Arguments
caption
text
button-x-text
Examples
Ex.1: Warning dialog
Anchor | ||||
---|---|---|---|---|
|
No Format | ||||
---|---|---|---|---|
| ||||
# A titled dialog with a message and OK button
qwarning Warning "This is a warning"
{noformat}
!att:_img_cmd^qwarning.png!
The above example shows the simplest use of *qwarning*. The *OK* button is created automatically.
h3. |
The above example shows the simplest use of qwarning. The OK button is created automatically.
Ex.2:
...
Information
...
dialog
...
with
...
extra
...
buttons
...
Anchor | ||||
---|---|---|---|---|
|
No Format | ||||
---|---|---|---|---|
| ||||
# Warning with title and buttons.
# Returns 0 (OK), 1 (Cancel), 2 (Details)
set button [qwarning "Open File" "Failed to open file" OK Cancel Details]
if { $button == 0 } {
# OK button was pressed
} elseif { $button == 1 } {
# Cancel buttons was pressed
} elseif { $button == 2 } {
# Details buttons was pressed
}
{noformat}
!att:_img_cmd^qwarning_buttons.png!
Example +Information dialog with extra buttons+ shows a warning dialog with a title and extra buttons. The number 0, 1, or 2 is returned to the program, depending on which button the user clicks.
{pagebreak} |
Example Information dialog with extra buttons shows a warning dialog with a title and extra buttons. The number 0, 1, or 2 is returned to the program, depending on which button the user clicks.