in reply to Re: Re: Tk bind mouse down question
in thread Tk bind mouse down question
sub my_test { shift; # don't know why I have to do this, but ...
You have to do that because when you bind a sub to an event, and that event occurs, the sub always gets the widget handle that received the event as its first arg.
It's done this way so that you can bind a sub to a given even in all widgets of a given type (or any bunch of widgets that are supposed to invoke the same behavior), and when the bound sub actually gets called, you have the reference to the particular widget that received the event, just because that may come in handy in a variety of different cases.
|
|---|