21
21
B<DialogBox> is very similar to B<Dialog> except that it allows
22
any widget in the top frame. B<DialogBox> creates two
23
frames---"top" and "bottom". The bottom frame shows all the
24
specified buttons, lined up from left to right. The top frame acts
22
any widget in the top Frame. B<DialogBox> creates two
23
Frames, I<top> and I<bottom>. The bottom Frame shows all the
24
specified Buttons, lined up from left to right. The top Frame acts
25
25
as a container for all other widgets that can be added with the
26
B<add()> method. The non-standard options recognized by
27
B<DialogBox> are as follows:
30
The options recognized by B<DialogBox> are as follows:
33
Specify the title of the dialog box. If this is not set, then the
36
Specify the title of the DialogBox. If this is not set, then the
34
37
name of the program is used.
38
The buttons to display in the bottom frame. This is a reference to
39
an array of strings containing the text to put on each
40
button. There is no default value for this. If you do not specify
41
any buttons, no buttons will be displayed.
41
The button names to display in the bottom Frame. This is a reference
42
to an array of strings containing the text to put on each
43
Button. There is no default value for this. If you do not specify any
44
button names, no Buttons are displayed.
43
46
=item B<-default_button>
45
Specifies the default button that is considered invoked when user
46
presses <Return> on the dialog box. This button is highlighted. If
47
no default button is specified, then the first element of the
48
Specifies the default Button that is considered invoked when user
49
presses <Return> on the DialogBox. This Button is highlighted. If
50
no default Button is specified, then the first element of the
48
51
array whose reference is passed to the B<-buttons> option is used
59
62
=item B<add(>I<widget>, I<options>B<)>
61
64
Add the widget indicated by I<widget>. I<Widget> can be the name
62
of any Tk widget (standard or contributed). I<Options> are the
63
options that the widget accepts. The widget is advertized as a
64
subwidget of B<DialogBox>.
66
=item B<Show(>I<grab>B<)>
68
Display the dialog box, until user invokes one of the buttons in
69
the bottom frame. If the grab type is specified in I<grab>, then
70
B<Show> uses that grab; otherwise it uses a local grab. Returns
71
the name of the button invoked.
65
of any Tk widget (standard or contributed). I<options> are the
66
options that the widget accepts. The widget is advertised as a
67
subwidget of B<DialogBox>. The first character of I<widget> is
68
lower-cased and used as the advertised name.
70
=item B<Show(>I<?-global?>B<)>
72
Displays the Dialog until the user invokes one of the Buttons in the
73
bottom Frame. If the grab type I<-global> is specified, then B<Show>
74
uses that grab; otherwise it defaults to a local grab. Returns the
75
name of the Button invoked.
77
The actual Dialog is shown using the B<Popup> method. Any other
78
options supplied to B<Show> are passed to B<Popup>, and can be used to
79
position the Dialog on the screen. Please read L<Tk::Popup> for
84
=head1 ADVERTISED WIDGETS
90
The subwidget reference to the top half of the DialogBox widget, the Frame
91
containing widgets added by the B<add> method.
95
The subwidget reference to the bottom half of the DialogBox widget, the Frame
96
containing the Button widgets.
98
=item B<B_"button-text">
100
Individual subwidget references to the Buttons in the DialogBox widget. The
101
subwidget name is the string I<B_> concatenated with the Button's -text
77
106
There is no way of removing a widget once it has been added to the
107
top frame, unless you access the I<top> subwidget and go through the
80
There is no control over the appearance of the buttons in the
81
bottom frame nor is there any way to control the placement of the
82
two frames with respect to each other e.g. widgets to the left,
83
buttons to the right instead of widgets on the top and buttons on
110
There is no control over the appearance of the Buttons in the
111
bottom Frame nor is there any way to control the placement of the
112
two Frames with respect to each other.