in reply to Re: what is difference between calling the function in Perl/Tk in the following ways
in thread what is difference between calling the function in Perl/Tk in the following ways
But it should only matter if the button is created more than once (and I'd only worry about that if it's created many times). On a single-window app where you only create widgets once, it really doesn't matter. If it does matter, then you can probably use Scalar::Util::weaken() to get around it (but by then I'd agree that it's probably easier to use the first method).my $button; $button = $frame->Button(... , -command => sub { SomeFunction($button) + });
|
|---|