Fit layout is a really expensive operation, which is why it isn't available at runtime. We've never had the need for this at runtime, so its never been a priority.
Your best bet is to simply replicate the code that runs in the button press in your runtime class. If you can evaluate the size of your controls by other means, eg. if you know that only the base objects need to be considered - all this function does is it finds the largest bounding box that covers all the controls and resizes the layout to fit that.