conf7819.file
[app.Builder.js] / src / Builder4 / GtkView.vala
index fbdbc1b..836103f 100644 (file)
@@ -18,7 +18,9 @@ public class Xcls_GtkView : Object
 
         // my vars (def)
     public Gtk.Widget lastObj;
+    public int width;
     public JsRender.JsRender file;
+    public int height;
 
     // ctor 
     public Xcls_GtkView()
@@ -28,21 +30,24 @@ public class Xcls_GtkView : Object
 
         // my vars (dec)
         this.lastObj = null;
+        this.width = 0;
         this.file = null;
+        this.height = 0;
 
         // set gobject values
         var child_0 = new Xcls_ScrolledWindow2( _this );
         child_0.ref();
-        this.el.pack_start (  child_0.el , true,true );
+        this.el.pack1 (  child_0.el , true,true );
         var child_1 = new Xcls_compile_view( _this );
         child_1.ref();
         this.el.pack2 (  child_1.el , true,true );
 
         // listeners 
-        this.el.show.connect( () => {
-            _this.compile_view.el.hide();
+        this.el.size_allocate.connect( (aloc) => {
         
-        });
+            this.width = aloc.width;
+            this.height =aloc.height;
+            });
     }
 
     // user defined functions 
@@ -98,16 +103,23 @@ public class Xcls_GtkView : Object
             // hide the compile view at present..
               
             
-            uint w,h;
+            var w = this.width;
+            var h = this.height;
             
-            _this.view_layout.el.get_size(out w, out h);
+            print("ALLOC SET SIZES %d, %d\n", w,h); 
             
             // set the container size min to 500/500 or 20 px less than max..
-            w = uint.max (w-20, 500);
-            h = uint.max (h-20, 500);        
-            _this.container.el.set_size_request((int)w,(int)h);
+            w = int.max (w-20, 500);
+            h = int.max (h-20, 500); 
+            
+            print("SET SIZES %d, %d\n", w,h);       
+            _this.container.el.set_size_request(w,h);
+            
+            _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.
+            var rgba = Gdk.RGBA ();
+            rgba.parse ("#ccc");
+            _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);
             
-            _this.view_layout.el.set_size(1000,1000); // should be baded on calc.. -- see update_scrolled.
             
        var x = new JsRender.NodeToGtk(file.tree);
             var obj = x.munge() as Gtk.Widget;