File: DialogBox.pod

package info (click to toggle)
perl-tk 1%3A800.025-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,444 kB
  • ctags: 19,081
  • sloc: ansic: 206,740; perl: 40,187; makefile: 4,371; sh: 2,373; yacc: 762
file content (121 lines) | stat: -rw-r--r-- 3,249 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121

=head1 NAME

Tk::DialogBox - create and manipulate a dialog screen.

=for pm Tixish/DialogBox.pm

=for category Tix Extensions

=head1 SYNOPSIS

    use Tk::DialogBox
    ...
    $d = $top->DialogBox(-title => "Title", -buttons => ["OK", "Cancel"]);
    $w = $d->add(Widget, args);
    ...
    $button = $d->Show;

=head1 DESCRIPTION

B<DialogBox> is very similar to B<Dialog> except that it allows
any widget in the top Frame. B<DialogBox> creates two
Frames, I<top> and I<bottom>. The bottom Frame shows all the
specified Buttons, lined up from left to right. The top Frame acts
as a container for all other widgets that can be added with the
B<add()> method.

=head1 OPTIONS

The options recognized by B<DialogBox> are as follows:

=over 4

=item B<-title>

Specify the title of the DialogBox. If this is not set, then the
name of the program is used.

=item B<-buttons>

The button names to display in the bottom Frame. This is a reference
to an array of strings containing the text to put on each
Button. There is no default value for this. If you do not specify any
button names, no Buttons are displayed.

=item B<-default_button>

Specifies the default Button that is considered invoked when user
presses <Return> on the DialogBox. This Button is highlighted. If
no default Button is specified, then the first element of the
array whose reference is passed to the B<-buttons> option is used
as the default.

=back

=head1 METHODS

B<DialogBox> supports only two methods as of now:

=over 4

=item B<add(>I<widget>, I<options>B<)>

Add the widget indicated by I<widget>. I<Widget> can be the name
of any Tk widget (standard or contributed). I<options> are the
options that the widget accepts. The widget is advertised as a
subwidget of B<DialogBox>. The first character of I<widget> is
lower-cased and used as the advertised name.

=item B<Show(>I<?-global?>B<)>

Displays the Dialog until the user invokes one of the Buttons in the
bottom Frame. If the grab type I<-global> is specified, then B<Show>
uses that grab; otherwise it defaults to a local grab. Returns the
name of the Button invoked.

The actual Dialog is shown using the B<Popup> method. Any other
options supplied to B<Show> are passed to B<Popup>, and can be used to
position the Dialog on the screen. Please read L<Tk::Popup> for
details.

=back

=head1 ADVERTISED WIDGETS

=over 4

=item B<top>

The subwidget reference to the top half of the DialogBox widget, the Frame
containing widgets added by the B<add> method.

=item B<bottom>

The subwidget reference to the bottom half of the DialogBox widget, the Frame
containing the Button widgets.

=item B<B_"button-text">

Individual subwidget references to the Buttons in the DialogBox widget. The
subwidget name is the string I<B_> concatenated with the Button's -text
value.

=head1 BUGS

There is no way of removing a widget once it has been added to the
top frame, unless you access the I<top> subwidget and go through the
child widgets.

There is no control over the appearance of the Buttons in the
bottom Frame nor is there any way to control the placement of the
two Frames with respect to each other.

=head1 AUTHOR

B<Rajappa Iyer> rsi@earthling.net

This code is distributed under the same terms as Perl.

=cut