The ternary operator ?: is not a statement but an expression. You should assign its result, not run two statements:
$toggle_autoplay = ($toggle_autoplay == 0) ? 1 : 0;
or, a bit shorter:
$toggle_autoplay = !$toggle_autoplay;
In reply to Re: Tk starting and stopping an autoplay loop using a keybinding
by Corion
in thread Tk starting and stopping an autoplay loop using a keybinding
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |