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 » Community » Newbie corner » Layout Designer and Menus
Re: Layout Designer and Menus [message #60602 is a reply to message #60599] Fri, 31 May 2024 08:27 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3443
Registered: August 2008
Senior Veteran
Hi Xbones

MenuBar is not included in the layout designer. You can simply include it and fill it with options.

You have an example here:
https://www.ultimatepp.org/srcdoc$CtrlLib$Tutorial$en-us.htm l

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct MyAppWindow : TopWindow {
   MenuBar menu;

   void Exit() {
       if(PromptOKCancel("Exit MyApp?"))
           Break();
   }
   void SubMenu(Bar& bar) {
       bar.Add("Exit", [=] { Exit(); });
   }
   void MainMenu(Bar& bar) {
       bar.Sub("Menu", [=](Bar& bar) { SubMenu(bar); });
   }
   MyAppWindow() {
       Title("My application with menu").Sizeable();
       AddFrame(menu);
       menu.Set([=](Bar& bar) { MainMenu(bar); });
   }
};

GUI_APP_MAIN
{
   MyAppWindow app;
   app.Run();
}


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Previous Topic: U++ and Python
Next Topic: dark RichEdit
Goto Forum:
  


Current Time: Sun Aug 24 11:44:26 CEST 2025

Total time taken to generate the page: 0.05282 seconds