Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
To be honest, I'm not very agile with object oriented programming , although I can work thru it, if I had code to run. In your case, from reading the description of your classes, it seems that you could define all the ItemStyles in your B base class, if B.pm is derived from Tk::Tree, then make all your D1 , D2, etc. classes as Derived from B. See perldoc Tk::Derived. That way they all inherit the settings. You might want to look at Using the Option Database. Possibly setting the the Option Database is the way to avoid the memory gain problems. Possibly in B.pm you could access the $mw with the SUPER. Something along the lines of
sub ClassInit { my ($class, $mw) = @_; $class->SUPER::ClassInit($mw); $mw->optionAdd("*tree*font", $text_font); $mw->optionAdd("*tree*foreground", $fgcolor); return $class; }
I'm sorry I can't help you further, maybe some Object Oriented monk can help you, but I'm totally non-OO in my thinking style. :-)

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re^3: ItemStyle causing high memory consumption by zentara
in thread ItemStyle causing high memory consumption by ghosh123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-20 00:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found