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:
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)
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.