Opened 4 years ago

Closed 4 years ago

#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: stable-latest
Keywords: submenu wxMenuItem Cc:
Blocked By: Blocking:
Patch: no

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"),

Change History (2)

comment:1 Changed 4 years ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted
  • Summary changed from Adding a Submenu wxMenuItem with doesn't show the Submenu to SetSubMenu doesn't work correctly for OSX_Cocoa

comment:2 Changed 4 years ago by SC

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [63015]) fixing SetSubMenu for OSX_Cocoa, fixes #11581

Note: See TracTickets for help on using tickets.