Clones.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 14 Nov 2018 08:04:25 +0000 (16:04 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 14 Nov 2018 08:04:25 +0000 (16:04 +0800)
Clones.vala

Clones.bjs
Clones.vala

index 9990de0..fbf8e44 100644 (file)
@@ -14,7 +14,7 @@
    },
    "boolean deletable" : true,
    "default_width" : 1024,
-   "| void show" : "()    {\n\n    \n    this.el.set_deletable(false);\n    this.el.set_gravity(Gdk.Gravity.NORTH);\n    this.el.move((Gdk.Screen.width() / 2 ) -400 ,0);\n    \n    this.el.set_default_size(\n\t\t\tint.min(1024,Gdk.Screen.width()),\n\t\t\tint.max(500,Gdk.Screen.width() - 300)\n\t);\n    \n    this.el.show_all();\n    _this.reposStore.load();\n    this.el.set_keep_above(true);\n    this.el.run();\n    // load clones..\n//     this.get('/reposStore').load();\n    \n    //this.get('/ok_button').el.set_sensitive(false);\n    \n    // block until we return.\n//    var run_ret = this.el.run();\n//    if (run_ret < 1 ) {\n//        return  \"DONE\";\n//    }\n//    print(\"RUN RETURN : \" + run_ret);\n//    return \"DONE\";\n    //print(JSON.stringify(this.get('bug').getValue()));\n   // return this.get('bug').getValue();\n    //this.success = c.success;\n}\n",
+   "| void show" : "()    {\n\n    \n    this.el.set_deletable(true);\n    this.el.set_gravity(Gdk.Gravity.NORTH);\n    this.el.move((Gdk.Screen.width() / 2 ) -400 ,0);\n    \n    this.el.set_default_size(\n\t\t\tint.min(1024,Gdk.Screen.width()),\n\t\t\tint.max(500,Gdk.Screen.width() - 300)\n\t);\n    \n    this.el.show_all();\n    _this.reposStore.load();\n    this.el.set_keep_above(true);\n    this.el.run();\n    // load clones..\n//     this.get('/reposStore').load();\n    \n    //this.get('/ok_button').el.set_sensitive(false);\n    \n    // block until we return.\n//    var run_ret = this.el.run();\n//    if (run_ret < 1 ) {\n//        return  \"DONE\";\n//    }\n//    print(\"RUN RETURN : \" + run_ret);\n//    return \"DONE\";\n    //print(JSON.stringify(this.get('bug').getValue()));\n   // return this.get('bug').getValue();\n    //this.success = c.success;\n}\n",
    "title" : "Manage Clones",
    "xtype" : "Dialog",
    "default_height" : 500,
@@ -80,6 +80,9 @@
          "$ xns" : "Gtk"
         },
         {
+         "listeners" : {
+          "clicked" : "() => {\n\t_this.el.response(0);\n\t\n}"
+         },
          "label" : "Close",
          "bool expand" : false,
          "* pack" : "add",
index 8118378..81ac408 100644 (file)
@@ -69,7 +69,7 @@ public class Clones : Object
     public void show ()    {
     
         
-        this.el.set_deletable(false);
+        this.el.set_deletable(true);
         this.el.set_gravity(Gdk.Gravity.NORTH);
         this.el.move((Gdk.Screen.width() / 2 ) -400 ,0);
         
@@ -443,6 +443,12 @@ public class Clones : Object
             // set gobject values
             this.el.expand = false;
             this.el.label = "Close";
+
+            //listeners
+            this.el.clicked.connect( () => {
+               _this.el.response(0);
+               
+            });
         }
 
         // user defined functions