1Dialog(3) User Contributed Perl Documentation Dialog(3)
2
3
4
6 Tk::Dialog - Create modal dialog and wait for a response.
7
9 $dialog = $parent->Dialog(-option => value, ... );
10
12 This procedure is part of the Tk script library - its arguments
13 describe a dialog box. After creating a dialog box, Dialog waits for
14 the user to select one of the Buttons either by clicking on the Button
15 with the mouse or by typing return to invoke the default Button (if
16 any). Then it returns the text string of the selected Button.
17
18 While waiting for the user to respond, Dialog sets a local grab. This
19 prevents the user from interacting with the application in any way
20 except to invoke the dialog box. See the Show() method.
21
23 The following option/value pairs are supported:
24
25 -title
26 Text to appear in the window manager's title bar for the dialog.
27
28 -text
29 Message to appear in the top portion of the Dialog.
30
31 -bitmap
32 If non-empty, specifies a bitmap to display in the top portion of
33 the Dialog, to the left of the text. If this is an empty string
34 then no bitmap is displayed in the Dialog.
35
36 -default_button
37 Text label string of the Button that displays the default ring.
38
39 -buttons
40 A reference to a list of Button label strings. Each string
41 specifies text to display in a Button, in order from left to right.
42
44 $answer = $dialog->Show(?-global?);
45 This method displays the Dialog, waits for the user's response, and
46 stores the text string of the selected Button in $answer. If
47 -global is specified a global (rather than local) grab is
48 performed.
49
50 The actual Dialog is shown using the Popup method. Any other
51 options supplied to Show are passed to Popup, and can be used to
52 position the Dialog on the screen. Please read Tk::Popup for
53 details.
54
56 Because Tk::Dialog is a subclass of Tk::DialogBox it inherits all the
57 advertised subwidgets of its superclass: e.g. "B_button-text", where
58 'button-text' is a Button's -text value. Additionally, Tk::Dialog
59 advertises:
60
61 message
62 The dialog's Label widget containing the message text.
63
64 bitmap
65 The dialog's Label widget containing the bitmap image.
66
68 $dialog = $mw->Dialog(-text => 'Save File?', -bitmap => 'question',
69 -title => 'Save File Dialog', -default_button => 'Yes', -buttons =>
70 [qw/Yes No Cancel/);
71
73 bitmap, dialog, modal, messageBox
74
75
76
77perl v5.32.0 2020-07-28 Dialog(3)