in reply to text->tagBind() question
What I don't understand is how/why I have to do the ...
my $theTextWidget = shift; # I don't know why this shows up!
... I didn't specify it as an argument in the tagBind call !?!?!?!
The reason for this is simple: all Tk callbacks pass the object reference as the first argument. Otherwise, your callback has no ready means by which to know which of the potentially many widgets was activated. It is in effect treating the callbacks as methods on the objects themselves. Just as any other class-method receives the object reference first, so do these.
While it may not be convenient if you have no plans to use the object itself, it's a realtively minor inconvenience overall. You can simply shift without assigning it, if you have no need for it.
--rjray
|
|---|