Change value of stateful button after event loop

Fixes #14450
Merge pull request #14457 from hnrch02/button-set-val-after-event-loop

Change value of stateful button after event loop