#include using namespace Upp; #define IMAGECLASS Imgs #define IMAGEFILE #include struct Dlg : TopWindow{ Button b; typedef Dlg CLASSNAME; Dlg() { Title("Dialog").Sizeable(); SetRect(0,0,300,200); Add(b.TopPos(10,20).LeftPos(10,100)); b.SetLabel("OK"); b<<=THISBACK(DoStuffAndExit); } void DoStuffAndExit(){ Hide(); Progress p; p.SetText("Pretending work..."); for(int i=0;i<100;i++){ Sleep(25); p.Step(); } Close(); } }; struct App : TopWindow { ToolBar tool; typedef App CLASSNAME; App() { Title("My application with bars").Sizeable(); AddFrame(tool); tool.Set(THISBACK(TBar)); } void MenuFn() { Dlg().Execute(); } void TBar(Bar& bar) { bar.Add("Function", Imgs::open(), THISBACK(MenuFn)); } }; GUI_APP_MAIN { App().Run(); }