in reply to I need help making loop-created buttons and entries match up...

You're creating a closure on $i (with your callback), but then you change $i later in the loop. What you need to do is create a closure on something that will stay locally with that individual closure:
for my $index (0..$#parts) { my $i = $index; # unique per loop iteration ... rest of your loop here ... }
This causes a unique $i per iteration, and thus will be closed properly with each callback.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Re: I need help making loop-created buttons and entries match up...
  • Download Code