]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/widget.cpp
Enable loading of widgets from datafiles (not implemented for all widgets yet)
[libs/gltk.git] / source / widget.cpp
index d1f21bc9408113c1d65fb78ca711d1f5d51f6adf..f03ed39652f5d56f416f28707674a9a8da5d3f54 100644 (file)
@@ -93,5 +93,29 @@ void Widget::render_text(const Part &part, const string &text) const
        GL::pop_matrix();
 }
 
+
+Widget::Loader::Loader(Widget &w):
+       wdg(w)
+{
+       add("position", &Loader::position);
+       add("size",     &Loader::size);
+       add("style",    &Loader::style);
+}
+
+void Widget::Loader::position(int x, int y)
+{
+       wdg.set_position(x, y);
+}
+
+void Widget::Loader::size(unsigned w, unsigned h)
+{
+       wdg.set_size(w, h);
+}
+
+void Widget::Loader::style(const string &s)
+{
+       wdg.set_style(s);
+}
+
 } // namespace GLtk
 } // namespace Msp