tracer_rock
tracer_rock

Reputation: 175

Submenu of a wxMenuItem

I wanted to have a submenu manually append to a submenu("History") under "Edit"

wxMenuBar * menubara = GetMenuBar();
wxMenu * menua = menubara->GetMenu(1);
wxInt32 menuIda = menua->FindItem(wxT("History"));    
wxMenuItem * menuItema = menua->FindItem(menuIda); 

This is how I get History as a wxMenuItem. However, there is no addSubMenu for wxMenuItem. How can I add a submenu to History?

Upvotes: 0

Views: 595

Answers (1)

Adrian Roman
Adrian Roman

Reputation: 531

From my memory, so I might be wrong: you have to create another menu (if it does not already have it, get it with GetSubMenu), insert a new menu item for the new entry and use wxMenuItem->SetSubMenu to set it.

Upvotes: 1

Related Questions