Fail to attach menubar on a subwindow

BlitzMax Forums/Brucey's Modules/Fail to attach menubar on a subwindow

MOBii(Posted 2016) [#1]
My first question is: Can I have a menubar on a subwindow?
(When I am on the subWindow my main menu keyboard shortcut doesn't work)
the toolbar works fine!
if I can have a menubar on a subwindow what do I do wrong?

I make a Subwindow with wxFrame, the subwindow behave well, except I can't tab thru the tabbed objects like: wxButton! (They get selected but I can't tab)
I can insert the menu: MOBii_SubWindow[q].menuBar.Insert the ok = 1
I don't get any Error message: MOBii_SubWindow[q].SetMenuBar(MOBii_SubWindow[q].menuBar)
MOBii_SubWindow[q].menuBar.RefreshMenuBar() say" "failed in Refrech(): can't refresh unattached menubar"

mod\wx.mod\wxmenubar.mod\wxmenubar.bmx:
Const wxDEFAULT_FRAME_STYLE:Int = wxSYSTEM_MENU | wxRESIZE_BORDER | wxMINIMIZE_BOX | ..
	wxMAXIMIZE_BOX | wxCLOSE_BOX | wxCAPTION | wxCLIP_CHILDREN


my Code:
MOBii_SubWindow[q] = New wxFrame.Create(po, b, _title, _x, _y, _w, _h, wxDEFAULT_FRAME_STYLE)
MOBii_SubWindow[q].menuBar = New wxMenuBar.Create(wxMB_DOCKABLE)
...
ok = MOBii_SubWindow[q].menuBar.Insert(_pos, MOBii_Menu[_q].Menu, MOBii_Menu[_q].title)		' ok = 1
...
MOBii_SubWindow[q].SetMenuBar(MOBii_SubWindow[q].menuBar)	' this line go throu!
MOBii_SubWindow[q].menuBar.RefreshMenuBar()			' <---------------- :: This Line wxWidgets Debug Alert



wxWidgets Debug Alert:
../../src/msw/menu.cpp(1103):assert ""IsAttached()"" failed in Refrech(): can't refresh unattached menubar
Do you want to stop the program?