in reply to Need help with binding event in Tk
Also - and this is a guess based on the odd indenting - did you intend that the while loop and following two statements be executed when $key eq "year"?
Try it this way:
$results->bind('<ButtonRelease-1>'=> sub{ $list = $results->curselection; if ($key eq "year") { &show($bros->{$data}->[$list]) } else { $index = 0; while($bros->{$ydx[$list]}->[$index]->{$key} !~ /$data +/i){ $index++; } $yr = $ydx[$list]; &show($bros->{$ydx[$list]}->[$index]); });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need help with binding event in Tk
by Popcorn Dave (Abbot) on Jul 24, 2004 at 18:43 UTC | |
by keszler (Priest) on Jul 25, 2004 at 07:19 UTC |