src/Builder4/GtkView.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 20 May 2015 08:52:50 +0000 (16:52 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 20 May 2015 08:52:50 +0000 (16:52 +0800)
src/Builder4/GtkView.vala

src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala

index 2a93e9f..710d6e4 100644 (file)
    "# Gtk.Widget lastObj" : "null",
    "| void loadFile" : "(JsRender.JsRender file) \n{\n        this.file = null;\n        \n        if (file.tree == null) {\n            return;\n        }\n       this.file = file;     \n        this.sourceview.loadFile();\n        \n        \n\n        if (this.lastObj != null) {\n            this.container.el.remove(this.lastObj);\n        }\n        \n        // hide the compile view at present..\n          \n        \n        var w = this.width;\n        var h = this.height;\n        \n        print(\"ALLOC SET SIZES %d, %d\\n\", w,h); \n        \n        // set the container size min to 500/500 or 20 px less than max..\n        w = int.max (w-20, 500);\n        h = int.max (h-20, 500); \n        \n        print(\"SET SIZES %d, %d\\n\", w,h);       \n        _this.container.el.set_size_request(w,h);\n        \n        _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n        var rgba = Gdk.RGBA ();\n        rgba.parse (\"#ccc\");\n        _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n        \n        \n\tvar x = new JsRender.NodeToGtk(file.tree);\n        var obj = x.munge() as Gtk.Widget;\n        this.lastObj = null;\n\tif (obj == null) {\n        \treturn;\n\t}\n\tthis.lastObj = obj;\n        \n        this.container.el.add(obj);\n        obj.show_all();\n        \n         \n        \n}\n ",
    "int width" : 0,
-   "xtype" : "VBox",
+   "xtype" : "Box",
    "# JsRender.JsRender file" : "null",
    "int height" : 0,
    "$ xns" : "Gtk",
+   "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "# Xcls_MainWindow main_window" : "",
    "items" : [
     {
index ccabdbb..edcbf07 100644 (file)
@@ -2,7 +2,7 @@ static Xcls_GtkView  _GtkView;
 
 public class Xcls_GtkView : Object
 {
-    public Gtk.VBox el;
+    public Gtk.Box el;
     private Xcls_GtkView  _this;
 
     public static Xcls_GtkView singleton()
@@ -29,7 +29,7 @@ public class Xcls_GtkView : Object
     public Xcls_GtkView()
     {
         _this = this;
-        this.el = new Gtk.VBox( true, 0 );
+        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
         // my vars (dec)
         this.lastObj = null;