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