1 #ifndef MSP_GLTK_USERINTERFACE_H_
2 #define MSP_GLTK_USERINTERFACE_H_
11 Encapsulates a Root widget and Logic associated with it. Allows looking up
17 class Loader: public DataFile::Loader
23 Loader(UserInterface &);
29 typedef std::map<std::string, Widget *> WidgetMap;
37 UserInterface(Resources &, Graphics::Window &);
38 Root &get_root() { return root; }
39 const Logic &get_logic() const { return logic; }
42 W &get_widget(const std::string &n) const
44 WidgetMap::const_iterator i = widgets.find(n);
46 throw KeyError("Unknown widget", n);
48 W *w = dynamic_cast<W *>(i->second);
50 throw Exception("Widget type mismatch");
56 void get_widget(const std::string &n, W *&w) const
58 w = &get_widget<W>(n);