Refactoring for non modal loops

See my reply here: Replacement for runDispatchLoopUntil()? - #23 by dave96

I don’t think this approach will work because you’re just trying to do the old thing without pumping the message loop so all the various UI events won’t get delivered.