Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | |
2 | =head1 NAME | |
3 | ||
4 | Tk::Derived - Base class for widgets derived from others | |
5 | ||
6 | =for pm Tk/Derived.pm | |
7 | ||
8 | =for category Derived Widgets | |
9 | ||
10 | =head1 SYNOPSIS | |
11 | ||
12 | package Tk::Whatever; | |
13 | require Tk::Something; | |
14 | require Tk::Derived; | |
15 | ||
16 | @ISA = qw(Tk::Derived Tk::Something); | |
17 | ||
18 | sub Populate | |
19 | { | |
20 | my ($cw,$args) = @_; | |
21 | ... | |
22 | $cw->SUPER::Populate($args); | |
23 | $cw->ConfigSpecs(...); | |
24 | ... | |
25 | } | |
26 | ||
27 | =head1 DESCRIPTION | |
28 | ||
29 | Tk::Derived is used with perl5's multiple inheritance to override some | |
30 | methods normally inherited from Tk::Widget. | |
31 | ||
32 | Tk::Derived should precede any Tk widgets in the class's @ISA. | |
33 | ||
34 | Tk::Derived's main purpose is to apply wrappers to C<configure> and C<cget> | |
35 | methods of widgets to allow the derived widget to add to or modify behaviour | |
36 | of the configure options supported by the base widget. | |
37 | ||
38 | The derived class should normally override the C<Populate> method provided | |
39 | by Tk::Derived and call C<ConfigSpecs> to declare configure options. | |
40 | ||
41 | The public methods provided by Tk::Derived are as follows: | |
42 | ||
43 | =over 4 | |
44 | ||
45 | =item -E<gt>ConfigSpecs(-I<key> =E<gt> [I<kind>, I<name>, I<Class>, I<default>], ...) | |
46 | ||
47 | =back | |
48 | ||
49 | =head1 SEE ALSO | |
50 | ||
51 | L<Tk::ConfigSpecs|Tk::ConfigSpecs> | |
52 | L<Tk::mega|Tk::mega> | |
53 | ||
54 | =cut | |
55 |