X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fuserinterface.h;h=04a9ccfd10b6cd815f1618f9a217fd3db59f39ff;hb=754751fd474c6eac073fa7e89a18142fc89cb4fb;hp=58eb5186698db462a7747d17c27ba275deea06ea;hpb=2b70e8801c43875ed3f4135bdd0141265cff0312;p=libs%2Fgltk.git diff --git a/source/userinterface.h b/source/userinterface.h index 58eb518..04a9ccf 100644 --- a/source/userinterface.h +++ b/source/userinterface.h @@ -1,6 +1,7 @@ #ifndef MSP_GLTK_USERINTERFACE_H_ #define MSP_GLTK_USERINTERFACE_H_ +#include #include "logic.h" #include "root.h" @@ -41,15 +42,7 @@ public: template W &get_widget(const std::string &n) const { - WidgetMap::const_iterator i = widgets.find(n); - if(i==widgets.end()) - throw KeyError("Unknown widget", n); - - W *w = dynamic_cast(i->second); - if(!w) - throw Exception("Widget type mismatch"); - - return *w; + return dynamic_cast(*get_item(widgets, n)); } template