#include using namespace Upp; struct MyCtrl : public Ctrl { int count = 0; virtual void Paint(Draw& w) override { w.DrawRect(GetSize(), White()); w.DrawText(2, 2, AsString(count)); } virtual void LeftDown(Point, dword) override { count++; Refresh(); } }; #define LAYOUTFILE #include struct Gui21 : public WithGui21Layout { Gui21(); }; Gui21::Gui21() { CtrlLayout(*this, "Window title"); } GUI_APP_MAIN { Gui21().Run(); }