How to auto scale widget when you click some button to let some widget popup?

Just dropping a link, answered here:

If you want this done with a button, call the script that’s shown on button click, either instead or in addition to.