Builder4/GtkView.bjs.F7KHMX
authorAlan Knowles <alan@roojs.com>
Wed, 10 Sep 2014 11:19:42 +0000 (19:19 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 10 Sep 2014 11:19:42 +0000 (19:19 +0800)
Builder4/GtkView.bjs
Builder4/GtkView.js.O2LHMX
Builder4/GtkView.js
Builder4/GtkView.vala.A3GHMX
Builder4/GtkView.vala

Builder4/GtkView.bjs
Builder4/GtkView.js
Builder4/GtkView.vala

index 4bf6aab..27eb5da 100644 (file)
@@ -11,7 +11,7 @@
             "# Gtk.Widget lastObj" : "null",
             "xtype" : "Viewport",
             "$ xns" : "Gtk",
-            "| void addNode" : "(JsRender.JsRender file) \n{\n    \n \n\n        if (file.tree == null) {\n            return;\n        }\n        \n \n\tvar x = new JsRender.NodeToGlade(file.tree,  \"\");\n\tvar str = x.munge();\n        var builder = new Gtk.Builder.from_string (str,str.length);\n        \n\tvar obj=  builder.get_object(file.tree.uid()) as Gtk.Widget;\n\tthis.lastObj = obj;\n        this.container.el.add(obj);\n}\n",
+            "| void addNode" : "(JsRender.JsRender file) \n{\n    \n \n\n        if (file.tree == null) {\n            return;\n        }\n        if (this.lastObj != null) {\n            this.container.remove(this.lastObj);\n        }\n \n\tvar x = new JsRender.NodeToGlade(file.tree,  \"\");\n\tvar str = x.munge();\n        var builder = new Gtk.Builder.from_string (str,str.length);\n        \n\tvar obj=  builder.get_object(file.tree.uid()) as Gtk.Widget;\n\tthis.lastObj = obj;\n        this.container.el.add(obj);\n}\n",
             "items" : [
                 {
                     "id" : "container",
index 95f37a6..fd77796 100644 (file)
@@ -22,7 +22,9 @@ GtkView=new XObject({
             if (file.tree == null) {
                 return;
             }
-            
+            if (this.lastObj != null) {
+                this.container.remove(this.lastObj);
+            }
      
        var x = new JsRender.NodeToGlade(file.tree,  "");
        var str = x.munge();
index bc7ce0d..549118a 100644 (file)
@@ -41,7 +41,9 @@ public class Xcls_GtkView : Object
             if (file.tree == null) {
                 return;
             }
-            
+            if (this.lastObj != null) {
+                this.container.remove(this.lastObj);
+            }
      
        var x = new JsRender.NodeToGlade(file.tree,  "");
        var str = x.munge();