X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=blobdiff_plain;f=source%2Fpanel.h;fp=source%2Fpanel.h;h=3abfee1cadb072c74f9f0b4229fda6acfb98b6cd;hp=43c0f41b64d91a0241d9211f761e5702f9d5a47e;hb=394e5c9969a30b604bfaf78fc05a8c2d5c98ab5b;hpb=90d5f5f2ebaeb8aaa4aa47a0c2207f96758cba8c diff --git a/source/panel.h b/source/panel.h index 43c0f41..3abfee1 100644 --- a/source/panel.h +++ b/source/panel.h @@ -1,6 +1,7 @@ #ifndef MSP_GLTK_PANEL_H_ #define MSP_GLTK_PANEL_H_ +#include #include #include "container.h" #include "layout.h" @@ -66,14 +67,13 @@ private: protected: std::vector nav_order; - Layout *layout = nullptr; + std::unique_ptr layout; static TypeRegistry widget_registry; static bool widget_registry_init_done; public: Panel(); - virtual ~Panel(); template static void register_child_type(const std::string &); @@ -115,7 +115,7 @@ void Panel::Loader::child(const std::string &n) template void Panel::Loader::unnamed_child() { - RefPtr chl = new T(); + std::unique_ptr chl = std::make_unique(); load_sub(*chl); obj.add(*chl.get()); last_widget = chl.release();