strat has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks
I constructed a little addon to Tk::Entry with Tk::Derived, and it works fine:
package Tk::MyEntryCheck; # ... some code like strict/warnings/... use base qw(Tk::Derived Tk::Entry); Construct Tk::Widget 'MyEntry'; sub Populate { # some code here }
But now I'd like to have a parameter like -widget => 'LabEntry' (or any other widget based on Tk::Entry) and automatically inherit from Tk::LabEntry (or whatever Entry widget the user specifies). Well, I could perhaps use a package Tk::Widget; and try to play around with eval and require and @ISA and the like. But is there an "official" way to write such user-selectable-parent-widgets?
Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Userdefined Tk::Derived parent for Widget-Addon
by Tanktalus (Canon) on Oct 02, 2005 at 20:28 UTC |