Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Array of TK::Checkbuttons not acting appropriately

by Koosemose (Pilgrim)
on Oct 02, 2006 at 02:35 UTC ( [id://575831]=note: print w/replies, xml ) Need Help??


in reply to Array of TK::Checkbuttons not acting appropriately

Yeah, as rcseege demonstrated in their example, there really isn't a need for a variable to hold the checkbox widgets, so all you really need is

$bill_table->Checkbutton(-variable=>\$checkboxvalue[$t])->pack;

I'm assuming that somewhere in your code you increment $t, since this appears to be just a snippet, or hopefully just a badly put together example. Ideally you'd want to create and pack your checkbuttons seperate from the rest of the code. Something along the lines of the following:

my @checkbox = (qw/fred george jimbo frank/); foreach $c (0..@#checkbox) { $bill_table->Checkbutton(-variable=>\$checkboxvalue[$c],-text=>@chec +kbox[$c])->pack; }

Update: What you really need to do, to help us help you is trim it down to just what's causing the error, but with enough code that we can actually run the script, it's alot easier to debug something when we have a working program, with the smallest amount of code that still generates the same error you get. and as rcseege said, you may just find out what's wrong yourself when trying to trim it down to a functional test case.

Just Another Perl Alchemist

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://575831]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-24 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found