Spawn.vala
[gitlive] / Spawn.vala
index 222bc0c..81a7594 100644 (file)
@@ -1,9 +1,10 @@
 
+/// # valac  --pkg gio-2.0 --pkg gtk+-3.0  --pkg posix Spawn.vala -o /tmp/Spawn
 
 using GLib;
+using Gtk;
 // compile valac 
 
-/// # valac  --pkg gio-2.0  --pkg posix Spawn.vala -o /tmp/Spawn
 
 
 ///using Gee; // for array list?
@@ -143,7 +144,7 @@ public class Spawn : Object
     }
 
     
-    bool ctx = false; // the mainloop ctx.
+    MainLoop ctx = null; // the mainloop ctx.
     
     /**
      * @property output {String} resulting output
@@ -240,8 +241,9 @@ public class Spawn : Object
             
             Process.close_pid(this.pid);
             this.pid = -1;
-            if (this.ctx) {
+            if (this.ctx != null) {
                 this.ctx.quit();
+                this.ctx = null;
             }
             this.tidyup();
         //print("DONE TIDYUP");
@@ -426,10 +428,10 @@ public class Spawn : Object
                         this.stderr += buffer;
                     }
                     //_this[prop] += x.str_return;
-                    if (this.debug) {
-                        stdout.print("%s : %s", prop , str_return);
+                    if (this.cfg.debug) {
+                        stdout.printf("%s : %s", prop , str_return);
                     }
-                    if (this.async) {
+                    if (this.cfg.async) {
                         try {
                             if ( Gtk.events_pending()) {
                                  Gtk.main_iteration();