]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/logic.cpp
Add method to get a Part by name
[libs/gltk.git] / source / logic.cpp
index 40d06b218b1aa4b01f9de19ac6df9189bad0d1bb..85ec710def369c7b6764e0cb69f0e628f03e8af6 100644 (file)
@@ -16,22 +16,22 @@ Logic::Loader::Loader(Logic &l, const map<string, Widget *> &w):
        logic(l),
        widgets(w)
 {
-       add("action", &Loader::action);
+       add("bind", &Loader::bind);
 }
 
-void Logic::Loader::action(const string &wdg, const string &data)
+void Logic::Loader::bind(const string &wdg, const string &data)
 {
-       map<string, Widget *>::const_iterator i=widgets.find(wdg);
+       map<string, Widget *>::const_iterator i = widgets.find(wdg);
        if(i==widgets.end())
                throw KeyError("Unknown widget", wdg);
 
-       unsigned colon=data.find(':');
-       WidgetAction act;
-       act.wdg=i->second;
-       act.type=data.substr(0, colon);
+       string::size_type colon = data.find(':');
+       WidgetBinding act;
+       act.wdg = i->second;
+       act.type = data.substr(0, colon);
        if(colon!=string::npos)
-               act.data=data.substr(colon+1);
-       logic.actions.push_back(act);
+               act.data = data.substr(colon+1);
+       logic.bindings.push_back(act);
 }
 
 } // namespace GLtk