mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
32 lines
500 B
C++
32 lines
500 B
C++
#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();
|
|
}
|