Commy_Code_Monkey has asked for the wisdom of the Perl Monks concerning the following question:
I can't seem to pass $count into the command to use as an identifier for this particular widget because it will change as $counter changes with time. I'm looking for a way to be able to identify which button was pressed. I've been trying to do it using x and y coordinates, but it has to be in a scrolling pane and it keeps screwing up my logic when the pane scrolls down. I'm relatively new to perl and Tk and I'm aware that using variables to define variables is poor practise at best. Thanks,sub makewidget{ $counter=shift; ${widget."$counter"}=$mw->Button( -command=>sub{configurewidget($counter)} )->pack(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Widget Information
by zentara (Cardinal) on Jan 23, 2009 at 20:09 UTC | |
by Commy_Code_Monkey (Acolyte) on Jan 23, 2009 at 20:23 UTC |