Callback macros reduce verbosity of instance method callbacks. They expect CLASSNAME to be typedef-ed as the type of current class and return method callbacks bound to the this pointer.
class MichaluvTest : public WithMichaluvTestLayout<TopWindow> { public: void ActionClose(); MichaluvTest(); typedef MichaluvTest CLASSNAME; // <------ };
MichaluvTest::MichaluvTest() { CtrlLayout(*this, "Window title"); close << [=] { Break(); }; // 1) We use a lambda function to define the event. // 2) The method to break the main loop is Break(), not Breaker() } GUI_APP_MAIN { MichaluvTest().Run(); }