in reply to simple tk counter
After pressing the button, I'm refreshing the window, but this doesn't seem to yield the desired result of showing the new value
Hi, I don't use Tk at all, but, maybe try:
... which will increment the value of $count before using it, instead of after.$mw -> Button( -text => 'Count', -command => sub { ++$count; $mw -> + update; } ) ->pack();
Hope this helps!
|
|---|