in reply to Re^2: TK Gui Help
in thread TK Gui Help
Why are you calling addtextbox() without arguments?
Do it like this, write code this way, pass arguments all over, keep track of the life cycle of your variables, its coping with scoping, only use variables you declare pass, never any others
sub GoTkGui { my $mw = tkinit; my @stackOfEntries; ## or %division or %meaningfulName SetUpTheCheeze( $mw, \@stackOfEntries ); } sub SetUpTheCheeze { my( $mw, $entriesRef ) = @_; ... $mw->Button(-text => 'Add Field', -command => [ \&addtextbox, $mw, + $entriesRef ], ); ... } sub addtextbox { my( $mw, $entriesRef ) = @_; ... ## you decide what you need want ## push @$entriesRef, $ent; ## push @$entriesRef, $entry_1; }
Re: Tk: Creating label in hash Re: TK Submenus (Tk::Menu , global variables/ spirit of strict), Re: widget box problem in tk
|
|---|