Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
In think you misunderstood me. I don't want the text on the button to change but I actually have a whole hash of Entry Boxes that need to have their information updated. Second, the varname was just an example. posted below is my current code (w/o the extra subroutines to save space)
se strict; use Tk 800.00; use Mysql; require Tk::Frame; require Tk::TextUndo; require Tk::Text; require Tk::Scrollbar; require Tk::Menu; require Tk::Menubutton; require Tk::Adjuster; require Tk::DialogBox; # Main Window my $mw = new MainWindow; $mw->geometry('800x600'); # Frames Setup my $lf = $mw->Frame->pack(qw/-side left -fill y/); my $rf = $mw->Frame->pack(qw/-side right -fill y/); # Menu Bar Setup my $mb = $mw->Menu(-menuitems => &menubar_menuitems() ); $mw->configure(-menu => $mb); $mw->title("INSCO Inventory Control"); #Set Up Serial Query Information my $label_input = $lf->Label(-text=>'Serial Number: ',)->pack(qw/-si +de top/); my $tf_serial = $lf->Entry(-width=>30)->pack(qw/-side top/); my $label_space = $lf->Label(-text=>'',)->pack(qw/-side top/); my $returned = "";
Right here is where I'm working.
##Set up query button my @info; my $button_submit = $lf->Button( -text => 'Search', -command => my \@info = \&get_data )->pack(qw//); print $info[1]; #Set Up Client Information my %field; my @names = (qw/tf_po tf_client tf_contact tf_phone tf_email tf_addres +s tf_city tf_state tf_zip tf_id tf_model/); my @sizes = ( 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30); my @labls = ("PO:", "Client:", "Contact:", "Contact Phone Number:", "C +ontact Email Address:", "Contact Post Address:", "", "" , "", "Client + Specified ID", "Model"); my @pos = (1,2,3,4,5,6,7,8,9,10,11); foreach (@names) { my $position = shift(@pos); $field{$_}{txvar} = ''; $field{$_}{label} = $rf->Label( -text => shift( @labls )) ->grid(-row => '$position', -col => '0', ); $field{$_}{entry} = $rf->Entry( -width => shift( @sizes ), -textvariable => '', )->grid(-row => '$position', -col => '2', ); } # Start the main event loop MainLoop; sub get_data { my $entered = $tf_serial->get; my $dbh = Mysql->connect("host", "database", "username", "******** +") or die("Could Not Connect To Server"); my $query = qq~SELECT * FROM inventory WHERE serial='$entered'~; my $sth = $dbh->query($query); my @arr = $sth->fetchrow; return(@arr); }

In reply to Should have explained better by ok
in thread Tk/Perl Command by ok

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2022-08-17 04:39 GMT
Find Nodes?
    Voting Booth?

    No recent polls found