3 This file is part of libmspgltk
4 Copyright © 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GLTK_USERINTERFACE_H_
9 #define MSP_GLTK_USERINTERFACE_H_
18 Encapsulates a Root widget and Logic associated with it. Allows looking up
24 class Loader: public DataFile::Loader
30 Loader(UserInterface &);
37 std::map<std::string, Widget *> widgets;
42 UserInterface(Resources &, Graphics::Window &);
43 Root &get_root() { return root; }
44 const Logic &get_logic() const { return logic; }
47 W &get_widget(const std::string &n) const
49 std::map<std::string, Widget *>::const_iterator i=widgets.find(n);
51 throw KeyError("Unknown widget", n);
53 W *w=dynamic_cast<W *>(i->second);
55 throw Exception("Widget type mismatch");
61 void get_widget(const std::string &n, W *&w) const