Menu dissappearing on resize()

I have a class that is derived from DocumentWindow and MenubarModel. My menu bar will show up fine so long as I don’t create a resized() function. Is there something I have to do in my resized() or paint() methods to ensure that menubar is redrawn after resized() is called? Or am I missing something? It’s getting pretty late and I’ve been at this a while so there’s a good chance I’m overlooking something stupid…

call the base DocumentWindow::resized() inside your resize.

void YourDocumentWindow::resized() { DocumentWindow::resized(); }

Why are you trying to override resized in DocumentWindow? Are you adding child components directly to DocumentWindow?


Thanks, that was just what I was looking for. My next issue is placing a toolbar into my window. I have a texteditor type component that I set as contentComponent. Is it Ok to place my toolbar directly into my document window or should it be part of content component? I’m doing the following in my DocumentWIndow constructor which I guess isn’t right, in light of not adding child components directly to a document window?

toolbar = new Toolbar();
toolbar->setBounds(10, 50, 800, 30);

All my menu functions are members of my document window so I thought it best to place my toolbar into the same class so that my menu functions get called when a user hits a toolbar button. Is this a odd way of doing things?

Yes put the toolbar inside your content component. You should probably look into the command manager if you want multiple controls to call the same events/command(s).

Thanks, I have a command manager already set up so I guess it’s only a matter of adapting it.