Hello zentara, Thanks for replying. A more elaborated exapmle could be like this say in D1.pm :

my $style1 = $tree-> ItemStyle ('text', -anchor => 'w', -font => 'Time +s 12',-justify => 'right'); $tree->ItemConfigure($self->treeEntryPath, $self->columnNo(), -text => + $result , -style => $style1 )

Similarly for $style2 in D1.pm

my $style2 = $tree->ItemStyle ('text', -anchor => 'e', -font => 'Couri +er 16' -foreground => 'red', -justify => 'left'); $tree->ItemConfigure($self->treeEntryPath, $self->columnNo(), -text => + $name , -style => $style2 )

Posting a running example would be difficult since it is part of big code base. All I need is to program the logic so that in place of $style1 or $style2 , I will call a base class function which will create the itemStyle there once for each parameter set and return it to the derived class. Say from D1.pm, I will call it like :

$style1 = $baseObject->getItemStyle($tree, 'text',-anchor =>'nw', -fg +=> 'red');

I need help in programming the logic in the getItemStyle() of base class, so that it can create the ItemStyle widget from the passed parameter and store them in a hash. So that for the same parameter combination later I don't need to create it again. From the hash key-value pair I will get the stored ItemStyle created earlier.


In reply to Re^2: ItemStyle causing high memory consumption by ghosh123
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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.