tkmessagebox: Tk alert dialog routines

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

These functions are wrappers around the tkmessageBox() method, in the style of TkInter.

Usage

1
2
3
4
5
6
7

Arguments

title

character string specifying title for dialog window

message

character string specifying message displayed inside the alert

...

extra arguments for tkmessageBox routine

Details

All methods above display a modal message dialog to allow the user to provide input. The application will wait until the user responds.

A list of other arguments is shown here:

default

character string specifying the default button of the dialog

detail

character string specifying a secondary message, usually displayed in a smaller font under the main message

parent

object of the class tkwin representing the window of the application for which this dialog is being posted.

type

character string specifying predefined set of buttons to be displayed (askquestion only). Possible values are:

abortretryignore

displays three buttons whose symbolic names are abort, retry and ignore

ok

displays one button whose symbolic name is ok

okcancel

displays two buttons whose symbolic names are ok and cancel

retrycancel

displays two buttons whose symbolic names are retry and cancel

yesno

displays two buttons whose symbolic names are yes and no

yesnocancel

displays three buttons whose symbolic names are yes, no and cancel

Value

The askquestion method returns character string of the button's symbolic name corresponding to the user response.

The askokcancel method returns TRUE if user responds OK.

The askyesno method returns TRUE if user responds YES.

The askretrycancel method returns TRUE if user responds RETRY.

Other methods are invoked for their side-effect.

Note

The parent argument controls display location. If specified, the dialog will be centered over the parent widget; otherwise, center screen.

Author(s)

P. Roebuck [email protected]

See Also

tkmessageBox

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  ## Not run: 
## Display informational dialog
showinfo('Gumptions', 'Stupid is as stupid does.')

## Ask a question (string response)
button <- askquestion("Proceed?",
                      "Destroy Western Civilization?",
                      detail="It's going down the tubes anyway...",
                      type="yesnocancel",
                      default="cancel")

## Ask a question (logical response)
toplevel <- tktoplevel()
if (askyesno('Install',
             'Are you sure you want to install SuperVirus?',
             default="no",
             parent=toplevel)) {
    cat("yes", "\n")
} else {
    cat("no", "\n")
}
  
## End(Not run)

tclish documentation built on May 31, 2017, 2:28 a.m.