From: Mikko Rasa Date: Sat, 26 Nov 2016 11:38:02 +0000 (+0200) Subject: Add a datafile statement to set an icon for an Image X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=commitdiff_plain;h=78e05360d70542d343401241ff9ddddfed18c5cd Add a datafile statement to set an icon for an Image --- diff --git a/source/image.cpp b/source/image.cpp index 0102a47..1da782d 100644 --- a/source/image.cpp +++ b/source/image.cpp @@ -129,5 +129,12 @@ void Image::on_reparent() update_icon(); } + +Image::Loader::Loader(Image &img): + DataFile::DerivedObjectLoader(img) +{ + add("icon", &Image::icon_name); +} + } // namespace GLtk } // namespace Msp diff --git a/source/image.h b/source/image.h index 1855610..8b857f4 100644 --- a/source/image.h +++ b/source/image.h @@ -12,6 +12,13 @@ A widget for displaying images. */ class Image: public Widget { +public: + class Loader: public Msp::DataFile::DerivedObjectLoader + { + public: + Loader(Image &); + }; + private: const GL::Texture2D *image; std::string icon_name;