mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 22:02:49 -06:00
34 lines
538 B
C++
34 lines
538 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", THISBACK(Exit));
|
|
}
|
|
|
|
void MainMenu(Bar& bar) {
|
|
bar.Add("Menu", THISBACK(SubMenu));
|
|
}
|
|
|
|
typedef MyAppWindow CLASSNAME;
|
|
|
|
MyAppWindow() {
|
|
Title("My application with menu").Sizeable();
|
|
menu.Set(THISBACK(MainMenu));
|
|
AddFrame(menu);
|
|
}
|
|
};
|
|
|
|
GUI_APP_MAIN
|
|
{
|
|
MyAppWindow app;
|
|
app.Run();
|
|
}
|