in reply to Re^2: passing TK object into a sub
in thread passing TK object into a sub

You are correct. Build all of your widgets ahead of time, and control their visibility by packing/packForgetting them. Your memory usage will stay constant that way. If you are talking about many widgets, that may never get used, only build them as you need them, and store them in a hash or array for easy manipulation. So you can do something like this, where you can set the variable for the checkbox, to $num, and when you click the checkbox, the $num will be sent to the sub.
my %entry; #global to store entries sub get_entry{ my $num = shift; if ( !Exists( $entry{$num}{'entry'} ) { $entry{$num}{'entry'} = $frame->Entry()->pack(); } else { #repack $entry{$num}{'entry'}->pack(); } }

I'm not really a human, but I play one on earth CandyGram for Mongo

Replies are listed 'Best First'.
Re^4: passing TK object into a sub
by vortmax (Acolyte) on Jul 16, 2008 at 15:54 UTC
    awesome, thank you very much