- _widgets.push_back (new LuaDialogDropDown (key, title, i.value ()["values"], dflt));
+ w = new LuaDialogDropDown (key, title, i.value ()["values"], dflt);
+ } else if (type == "file") {
+ std::string path;
+ if (i.value ()["path"].isString ()) {
+ path = i.value ()["path"].cast<std::string> ();
+ }
+ w = new LuaFileChooser (key, title, Gtk::FILE_CHOOSER_ACTION_OPEN, path);
+ } else if (type == "folder") {
+ std::string path;
+ if (i.value ()["path"].isString ()) {
+ path = i.value ()["path"].cast<std::string> ();
+ }
+ w = new LuaFileChooser (key, title, Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER, path);
+ } else if (type == "color") {
+ w = new LuaColorPicker (key);
+ }
+
+ if (w) {
+ if (i.value ()["col"].isNumber ()) {
+ w->set_col (i.value ()["col"].cast<int> ());
+ }
+ if (i.value ()["colspan"].isNumber ()) {
+ w->set_span (i.value ()["colspan"].cast<int> ());
+ }
+ _widgets.push_back(w);