0

As a really simplistic example, suppose I have a single button and each time I click the button I want it to call a different callback. So, it is first set up to call hello(), then hello() changes things so the next time the button is clicked it calls world().

Colin Wu
  • 611
  • 7
  • 25

1 Answers1

0

RTFM!!!

Turns out any of the attributes of a widget can be changed with the 'configure' method:

...
$btn = $frame->$new_ttk__button(-text => "hello", -command => \&say_hello());
Tkx::MainLoop();

sub somefunc_invoked_by_some_other_button {
  $btn->configure(-text => "goodbye", -command => \&say_bye());
}
Colin Wu
  • 611
  • 7
  • 25