X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fuserinterface.h;h=04a9ccfd10b6cd815f1618f9a217fd3db59f39ff;hb=754751fd474c6eac073fa7e89a18142fc89cb4fb;hp=9ce08c38e08f6e64dd568b282b38c40b81837dc3;hpb=2f70d404230954f0693a62a021b5d2ad1faed8fa;p=libs%2Fgltk.git diff --git a/source/userinterface.h b/source/userinterface.h index 9ce08c3..04a9ccf 100644 --- a/source/userinterface.h +++ b/source/userinterface.h @@ -1,13 +1,7 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2008 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GLTK_USERINTERFACE_H_ #define MSP_GLTK_USERINTERFACE_H_ +#include #include "logic.h" #include "root.h" @@ -48,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