£okì has asked for the wisdom of the Perl Monks concerning the following question:
Monks of honor:
I've come to realize that Tk does have some limitations that I need to know how to get around. I have a button that leads to a command:
This works perfectly to build a button but once I'm in the subroutine, I no longer can use the Tk command configure to update other fields. This is necessary. My program works so that it takes the information from a field when you click the button, searches a database for a match and returns the matching row. (to make a long story short)
What I really need to do is find out some way to use the configure command for Tk inside that subroutine or know how to make a button in which I can save a varriable (like below but note: this does not work.
In case anyone is wondering, below is posted the error I get when I try to run the command. (inside the subroutine)
The Error Message:
my $button_submit = $lf->Button( -text => 'Search', -command => \&get_data )->pack(qw//);
This works perfectly to build a button but once I'm in the subroutine, I no longer can use the Tk command configure to update other fields. This is necessary. My program works so that it takes the information from a field when you click the button, searches a database for a match and returns the matching row. (to make a long story short)
What I really need to do is find out some way to use the configure command for Tk inside that subroutine or know how to make a button in which I can save a varriable (like below but note: this does not work.
my @info; my $button_submit = $lf->Button( -text => 'Search', -command => \@info = \&get_data )->pack(qw//);
In case anyone is wondering, below is posted the error I get when I try to run the command. (inside the subroutine)
$varname->configure(-textvariable => 'helloo');
The Error Message:
Tk::Error: Can't call method "configure" on an undefined value at disp +atch.pl li ne 158. [\&main::__ANON__] Tk callback for .frame.button Tk::__ANON__ at C:/Perl/site/lib/Tk.pm line 228 Tk::Button::butUp at C:/Perl/site/lib/Tk/Button.pm line 111 (command bound to event)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk/Perl Command
by pg (Canon) on Mar 20, 2003 at 18:13 UTC | |
by aquarium (Curate) on Mar 21, 2003 at 02:12 UTC | |
by £okì (Scribe) on Mar 20, 2003 at 18:49 UTC | |
Re: Tk/Perl Command
by hiseldl (Priest) on Mar 20, 2003 at 18:02 UTC | |
Re: Tk/Perl Command
by Courage (Parson) on Mar 20, 2003 at 17:10 UTC | |
by £okì (Scribe) on Mar 20, 2003 at 17:29 UTC |
Back to
Seekers of Perl Wisdom