Builder4/GtkView.bjs
authorAlan Knowles <alan@roojs.com>
Fri, 19 Sep 2014 10:07:50 +0000 (18:07 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 19 Sep 2014 10:07:50 +0000 (18:07 +0800)
Builder4/GtkView.vala

Builder4/GtkView.bjs
Builder4/GtkView.vala

index 2260f1f..02160f4 100644 (file)
@@ -6,5 +6,9 @@
     "permname" : "",
     "modOrder" : "",
     "items" : [
+        {
+            "xtype" : "Vpaned",
+            "$ xns" : "Gtk"
+        }
     ]
 }
\ No newline at end of file
index 9665aa9..0b7c240 100644 (file)
-static Xcls_GtkView  _GtkView;
+static GtkView  _GtkView;
 
-public class Xcls_GtkView : Object 
+public class GtkView : Object 
 {
-    public Gtk.Viewport el;
-    private Xcls_GtkView  _this;
+    public Gtk.Vpaned el;
+    private GtkView  _this;
 
-    public static Xcls_GtkView singleton()
+    public static GtkView singleton()
     {
         if (_GtkView == null) {
-            _GtkView= new Xcls_GtkView();
+            _GtkView= new GtkView();
         }
         return _GtkView;
     }
-    public Xcls_container container;
 
         // my vars (def)
-    public Gtk.Widget lastObj;
-    public JsRender.JsRender file;
 
     // ctor 
-    public Xcls_GtkView()
+    public GtkView()
     {
         _this = this;
-        this.el = new Gtk.Viewport( null, null );
+        this.el = new Gtk.Vpaned();
 
         // my vars (dec)
-        this.lastObj = null;
-        this.file = null;
-
-        // set gobject values
-        var child_0 = new Xcls_container( _this );
-        child_0.ref();
-        this.el.add (  child_0.el  );
     }
 
     // user defined functions 
-    public void loadFile (JsRender.JsRender file) 
-    {
-        
-     
-            this.file = null;
-            
-            if (file.tree == null) {
-                return;
-            }
-            this.file = file;
-            if (this.lastObj != null) {
-                this.container.el.remove(this.lastObj);
-            }
-     
-       var x = new JsRender.NodeToGtk(file.tree);
-            var obj = x.munge() as Gtk.Widget;
-            this.lastObj = null;
-       if (obj == null) {
-               return;
-       }
-       this.lastObj = obj;
-            
-            this.container.el.add(obj);
-            obj.show_all();
-    }
-    public void createThumb () {
-        
-        
-        if (this.file == null) {
-            return;
-        }
-        var filename = this.file.getIconFileName(false);
-        
-        var  win = this.el.get_parent_window();
-        var width = win.get_width();
-        var height = win.get_height();
-    
-        Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?
-    
-        screenshot.save(filename,"png");
-        return;
-        
-        
-        
-        
-        
-         
-        
-        // should we hold until it's printed...
-        
-          
-    
-        
-        
-    
-    
-        
-         
-    }
-    public class Xcls_container : Object 
-    {
-        public Gtk.HBox el;
-        private Xcls_GtkView  _this;
-
-
-            // my vars (def)
-
-        // ctor 
-        public Xcls_container(Xcls_GtkView _owner )
-        {
-            _this = _owner;
-            _this.container = this;
-            this.el = new Gtk.HBox( true, 0 );
-
-            // my vars (dec)
-
-            // set gobject values
-        }
-
-        // user defined functions 
-    }
 }