#pragma once #include class GLazyWidget : public GWidget { C_OBJECT(GLazyWidget) public: virtual ~GLazyWidget() override; Function on_first_show; protected: explicit GLazyWidget(GWidget* parent = nullptr); private: virtual void show_event(GShowEvent&) override; bool m_has_been_shown { false }; };