If you need to load a dynamic menu into a window you need to resize the window also dynamicly. This is also necessary if you want to avoid scrollbars by using different font sizes. That's why here is a simple example.