]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/widget.cpp
Adapt to DataFile changes
[libs/gltk.git] / source / widget.cpp
index d1f21bc9408113c1d65fb78ca711d1f5d51f6adf..8674a138ab7b6cf240ff7510524c346e3265a77a 100644 (file)
@@ -58,7 +58,7 @@ void Widget::update_style()
                sname+='-';
                sname+=style_name;
        }
-       style=&res.get<Style>(sname);
+       style=res.get<Style>(sname);
 }
 
 void Widget::render_part(const Part &part) const
@@ -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