In the doc/view architecture, you have a wxDocument and a wxView, managed by a wxDocManager, and they create new frames for a "file->new" command, for example, on demand.
If you are working with wxDocMDIParent and Child frames, when a new child is created, it overrides the main parent frame's menu.
The thing is, I only have direct access to the main parent frame, since I created is as global, so I can say, for example,
Code: Select all
mainFrame->GetMenuBar()->Check(ID_WHATEVER, true );
What happens when that code runs and a document is already open? nothing(aparently), because that document's menu is overriding the main frame's menu. So I need to run that code with a pointer to the child frame, instead of "mainFrame->" so I can see the menu which ID I set to be checked.
The question is, how can I get this pointer to the child frame when wxView is creating it on demand and I don't know where it is?