Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Menus&Toolbars » Disable/Enable Menu item during runtime
Re: Disable/Enable Menu item during runtime [message #23458 is a reply to message #23456] Wed, 21 October 2009 05:51 Go to previous message
Novo is currently offline  Novo
Messages: 1430
Registered: December 2006
Ultimate Contributor
You need to use method Add, which has a signature below. And you need to recreate menu each time. This is a pretty optimized procedure.

	Item&  Add(bool enable, const char *text, Callback callback);


Your code should look like below.

void MainMenu(Bar& bar) {
   bar.Add("File", THISBACK(SubFileMenu)).Help("File Menu");
   bar.Add(SectionIsEnabled(), "Section", THISBACK(SubSectionMenu)).Help("Section Menu");
}



Regards,
Novo
 
Read Message
Read Message
Previous Topic: ToolBar enabling and disabling question
Next Topic: Bigger images/icons in menu
Goto Forum:
  


Current Time: Wed May 14 08:32:14 CEST 2025

Total time taken to generate the page: 0.00838 seconds