X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Sample%2FEditor.js;h=cfbd524401885754abfada0223bb9d0bc96cd813;hb=8474bcfdf36aa545356c88a4afdfd7aa2bb77dc3;hp=82a603758f983d38b15209285b895fab497b43d4;hpb=235188bb50cdd915e3d5405c393fb9403324016d;p=app.Builder.js diff --git a/Sample/Editor.js b/Sample/Editor.js index 82a603758..cfbd52440 100644 --- a/Sample/Editor.js +++ b/Sample/Editor.js @@ -14,7 +14,7 @@ Editor=new XObject({ xtype: Gtk.Window, listeners : { destroy_event : function (self, event) { - if (!this.get('/Editor.buffer').checkSyntax) { + if (!this.save()) { // no hiding with errors. return true; } @@ -22,7 +22,11 @@ Editor=new XObject({ return true; }, delete_event : function (self, event) { - this.el.hide(); + if (!this.save()) { + // no hiding with errors. + return true; + } + this.el.hide(); return true; }, configure_event : function (self, object) {