]> git.tdb.fi Git - libs/gltk.git/blob - source/userinterface.cpp
Rework how widget ownership works in Container
[libs/gltk.git] / source / userinterface.cpp
1 #include "userinterface.h"
2
3 namespace Msp {
4 namespace GLtk {
5
6 UserInterface::UserInterface(Resources &r, Graphics::Window &w):
7         root(r, w)
8 { }
9
10
11 UserInterface::Loader::Loader(UserInterface &u):
12         ui(u)
13 {
14         add("logic", &Loader::logic);
15         add("root",  &Loader::root);
16 }
17
18 void UserInterface::Loader::logic()
19 {
20         load_sub(ui.logic, ui.widgets);
21 }
22
23 void UserInterface::Loader::root()
24 {
25         load_sub(ui.root, ui.widgets);
26 }
27
28 } // namespace GLtk
29 } // namespace Msp