in reply to Problems after upgrading both Perl and Tk
Instead of this (whitespace adjusted for legibility):
Try it like this:my $DoButton = $mode_buttons->Button( -text => 'Continue', -command => sub {&do_setup()} )->pack (-side => 'left', -expand => 1);
Also, wherever you had this:my $DoButton = $mode_buttons->Button( -text => 'Continue', -command => \&do_setup ### provide a code_ref, not anon_ +sub )->pack (-side => 'left', -expand => 1);
I would replace it with:... -command => sub {&getTool();&CleanUp();},
just on general principles.... -command => sub {getTool();CleanUp();}, ### drop the "&"
I'm not sure I can explain why the difference seems to matter, but I should have known that such a change would just be cosmetic -- no reason it should affect behavior -- but still, wherever a -command parameter is simply supposed to invoke a sub with no args, the value of that parameter should be the code_ref that points to that sub.
And whenever you need to pass args to the subroutine, provide an anon.array containing the code ref and the args:
... -command => [ \&func_name, $arg1, $arg2 ],
UPDATE: NEVERMIND! This is stranger than I thought -- the behavior I'm getting is not actually following a pattern yet. I'm seeing alternations between "resizes as intended" and "shrinks to unusable size". Perhaps someone else will figure it out while I'm struggling with this...
|
|---|