Yes, a switch is absolutely require to achieve this. To cut a long story short, this is the philosophically correct way to do it and it would work well. We are breaking the law slightly, pretending that widget creation is not I/O. Basically we are pretending we are working with an imaginary functional GUI library.
The only discussion of this in the book is in Chapter 7, and the screen switching is the closest to that use case.