#include #include using namespace Upp; #define LAYOUTFILE #include class GLCtrlBug : public WithGLCtrlBugLayout { public: typedef GLCtrlBug CLASSNAME; GLCtrlBug(); void test(); }; GLCtrlBug::GLCtrlBug() { CtrlLayout(*this, "Window title"); _button <<= THISBACK(test); } void GLCtrlBug::test() { if(_glCtrl.GetParent()) RemoveChild(&_glCtrl); else Add(_glCtrl); } GUI_APP_MAIN { GLCtrlBug().Run(); }