From 8474bcfdf36aa545356c88a4afdfd7aa2bb77dc3 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 1 Nov 2010 11:26:49 +0800 Subject: [PATCH] Sample/Editor.js --- Sample/Editor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) { -- 2.39.2