"gint default_height" : 500,
"gboolean deletable" : true,
"xtype" : "Dialog",
- "| string show" : " (Gtk.Window parent, JsRender.Node node) {\n \n \n this.el.set_transient_for(parent);\n this.el.modal = true;\n \n \n \n this.el.show_all();\n var ret = \"\";\n while (true) {\n var response_id = this.el.run();\n if (response_id < 1) {\n this.el.hide();\n return \"\";\n }\n \n name = _this.name.el.get_text();\n if (name.length < 1) {\n StandardErrorDialog.singleton().show(\n _this.el,\n \"You must give the template a name. \"\n );\n continue;\n }\n if (!Regex.match_simple (\"^[A-Za-z][A-Za-z0-9.]+$\", name) )\n {\n StandardErrorDialog.singleton().show(\n _this.el,\n \"Template Name must contain only letters dots\"\n );\n continue;\n }\n break;\n }\n var f = project.newFile(name);\n f.tree = _this.data.deepClone();\n f.save();\n \n // now we save it..\n this.el.hide();\n \n return name;\n \n \n \n}\n",
+ "| string show" : " (Gtk.Window ?parent, string text) {// JsRender.Node node) {\n \n if (parent != null) {\n this.el.set_transient_for(parent);\n this.el.modal = true;\n }\n \n \n \n this.el.show_all();\n var ret = \"\";\n while (true) {\n var response_id = this.el.run();\n if (response_id < 1) {\n this.el.hide();\n return \"\";\n }\n // keep showing...?\n break;\n }\n \n // now we save it..\n this.el.hide();\n \n return ret;\n \n \n \n}\n",
"$ xns" : "Gtk",
"gint default_width" : 500,
"gboolean modal" : true,
}
// user defined functions
- public string show (Gtk.Window parent, JsRender.Node node) {
+ public string show (Gtk.Window ?parent, string text) {// JsRender.Node node) {
-
- this.el.set_transient_for(parent);
- this.el.modal = true;
+ if (parent != null) {
+ this.el.set_transient_for(parent);
+ this.el.modal = true;
+ }
this.el.hide();
return "";
}
-
- name = _this.name.el.get_text();
- if (name.length < 1) {
- StandardErrorDialog.singleton().show(
- _this.el,
- "You must give the template a name. "
- );
- continue;
- }
- if (!Regex.match_simple ("^[A-Za-z][A-Za-z0-9.]+$", name) )
- {
- StandardErrorDialog.singleton().show(
- _this.el,
- "Template Name must contain only letters dots"
- );
- continue;
- }
+ // keep showing...?
break;
}
- var f = project.newFile(name);
- f.tree = _this.data.deepClone();
- f.save();
// now we save it..
this.el.hide();
- return name;
+ return ret;