in reply to Help me understand inheritance please!

If you are looking to group Tk widgets together, you want to consider Tk mega-widgets. You can make new widgets by deriving from an existing widget, or by composition. I refer you to Steve Lidie's excellent book Mastering Perl/TK

This is a somewhat different approach from the standard @ISA type inheritance that is Perl OO

--
I'm Not Just Another Perl Hacker

  • Comment on Re: Help me understand inheritance please!

Replies are listed 'Best First'.
Re^2: Help me understand inheritance please!
by jdtoronto (Prior) on Nov 04, 2004 at 19:34 UTC
    Thanks rinceWind,

    Another interesting suggestion. By your method I could take my BrowseEntry, wrap it up in a MegaWidget with the code for its associated events (listcmd and browsecmd in this case) and then use it wherever that functionality is needed. That would work, and as I think about it I could pass a coderef into the megawidget for another method that needs to be run whenever a value is selected from the drop-down.

    My copy of Steve Lidie's Mastering Perl/Tk is right beside me and is falling apaprt in some places! Almost time to go and buy another.

    jdtoronto