1tk_messageBox(n)             Tk Built-In Commands             tk_messageBox(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       tk_messageBox - pops up a message window and waits for user response.
9

SYNOPSIS

11       tk_messageBox ?option value ...?
12_________________________________________________________________
13
14

DESCRIPTION

16       This  procedure  creates and displays a message window with an applica‐
17       tion-specified message, an icon and a set of buttons.  Each of the but‐
18       tons in the message window is identified by a unique symbolic name (see
19       the -type options).  After the message window is popped up, tk_message‐
20       Box  waits  for  the user to select one of the buttons. Then it returns
21       the symbolic name of the selected button.
22
23       The following option-value pairs are supported:
24
25       -default name
26              Name gives the symbolic name of the default button for this mes‐
27              sage window ('ok', 'cancel', and so on). See -type for a list of
28              the symbolic names.  If this option is not specified, the  first
29              button in the dialog will be made the default.
30
31       -icon iconImage
32              Specifies  an icon to display. IconImage must be one of the fol‐
33              lowing: error, info, question or warning. If this option is  not
34              specified, then the info icon will be displayed.
35
36       -message string
37              Specifies the message to display in this message box.
38
39       -parent window
40              Makes  window the logical parent of the message box. The message
41              box is displayed on top of its parent window.
42
43       -title titleString
44              Specifies a string to display as the title of the  message  box.
45              The default value is an empty string.
46
47       -type predefinedType
48              Arranges  for  a  predefined set of buttons to be displayed. The
49              following values are possible for predefinedType:
50
51              abortretryignore  Displays three buttons  whose  symbolic  names
52                                are abort, retry and ignore.
53
54              ok                Displays one button whose symbolic name is ok.
55
56              okcancel          Displays  two buttons whose symbolic names are
57                                ok and cancel.
58
59              retrycancel       Displays two buttons whose symbolic names  are
60                                retry and cancel.
61
62              yesno             Displays  two buttons whose symbolic names are
63                                yes and no.
64
65              yesnocancel       Displays three buttons  whose  symbolic  names
66                                are yes, no and cancel.
67

EXAMPLE

69              set answer [tk_messageBox -message "Really quit?" -type yesno -icon question]
70              switch -- $answer {
71                  yes exit
72                  no {tk_messageBox -message "I know you like this application!" \
73                          -type ok}
74              }
75
76

KEYWORDS

78       message box
79
80
81
82Tk                                    4.2                     tk_messageBox(n)
Impressum