#include <CtrlLib/CtrlLib.h>

struct MyAppWindow : TopWindow {
	MenuBar menu;

	void Exit() {
		if(PromptOKCancel("Exit MyApp?"))
			Break();
	}
	
	void LocalMenu(Bar& bar) {
		bar.Add("Exit", THISBACK(Exit));
	}

	void RightDown(Point, dword) {
		MenuBar::Execute(THISBACK(LocalMenu));
	}

	typedef MyAppWindow CLASSNAME;

	MyAppWindow() {
		Title("My application with local menu").Sizeable();
	}
};

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