Ticket #11581 (closed defect: fixed)
SetSubMenu doesn't work correctly for OSX_Cocoa
| Reported by: | Mdx4 | Owned by: | csomor |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | wxOSX-Cocoa | Version: | 2.9-svn |
| Keywords: | submenu wxMenuItem | Cc: | |
| Blocked By: | Patch: | no | |
| Blocking: |
Description
Adding a SubMenu Menu Item shows only the Item without the SubMenu.
I was able to reproduce the bug with this patch to the menu sample ..
Index: samples/menu/menu.cpp
===================================================================
--- samples/menu/menu.cpp (revision 63002)
+++ samples/menu/menu.cpp (working copy)
@@ -1055,6 +1055,12 @@
{
menu.Append(Menu_Help_About, wxT("&About"));
menu.Append(Menu_Popup_Submenu, wxT("&Submenu"), CreateDummyMenu(NULL));
+
+ // Adding SubMenu as MenuItem
+ wxMenuItem* TestItem = new wxMenuItem( &menu, -1, wxT("SubMenuAsItem") );
+ TestItem->SetSubMenu(CreateDummyMenu(NULL));
+ menu.Append(TestItem);
+
menu.Append(Menu_Popup_ToBeDeleted, wxT("To be &deleted"));
menu.AppendCheckItem(Menu_Popup_ToBeChecked, wxT("To be &checked"));
menu.Append(Menu_Popup_ToBeGreyed, wxT("To be &greyed"),
