spx2 has asked for the wisdom of the Perl Monks concerning the following question:
Suppose we have multiple Tk buttons. And in -command of each one,the button needs to know wich one it is. A certain -text featuring a unique number for each button can be set when creating them,and then it can be used again by doing something like my $self = shift; my $ label = $self->cget('-text'); and then one can process $label in the manner needed so that he gets the unique number described above and then proceeding according to that number. Is there another way that one can store information in a button ? How can one get the name of the button from inside the -command subroutine.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: a Tk object who knows who he is ?
by liverpole (Monsignor) on Aug 21, 2007 at 15:45 UTC | |
by spx2 (Deacon) on Aug 24, 2007 at 10:17 UTC | |
|
Re: a Tk object who knows who he is ?
by zentara (Cardinal) on Aug 21, 2007 at 16:30 UTC |