src/Builder4/ValaCompileResults.bjs
[app.Builder.js] / src / Builder4 / ValaCompileResults.vala
1 static Xcls_ValaCompileResults  _ValaCompileResults;
2
3 public class Xcls_ValaCompileResults : Object
4 {
5     public Gtk.Popover el;
6     private Xcls_ValaCompileResults  _this;
7
8     public static Xcls_ValaCompileResults singleton()
9     {
10         if (_ValaCompileResults == null) {
11             _ValaCompileResults= new Xcls_ValaCompileResults();
12         }
13         return _ValaCompileResults;
14     }
15     public Xcls_compile_view compile_view;
16     public Xcls_sourceview sourceview;
17
18         // my vars (def)
19     public Xcls_MainWindow window;
20     public bool active;
21
22     // ctor
23     public Xcls_ValaCompileResults()
24     {
25         _this = this;
26         this.el = new Gtk.Popover( null );
27
28         // my vars (dec)
29         this.active = false;
30
31         // set gobject values
32         this.el.width_request = 600;
33         this.el.height_request = 400;
34         this.el.modal = true;
35         this.el.position = Gtk.PositionType.TOP;
36         var child_0 = new Xcls_compile_view( _this );
37         child_0.ref();
38         this.el.add (  child_0.el  );
39     }
40
41     // user defined functions
42     public void show ( Gtk.Widget onbtn) {
43         this.window.el.get_size(out w, out h);
44         
45         // left tree = 250, editor area = 500?
46         
47         var new_w = int.min(500, w-100);
48         if (new_w > (w-100)) {
49             new_w = w-100;
50         }
51         this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));
52      
53     
54         if (this.el.relative_to == null) {
55             this.el.set_relative_to(onbtn);
56         }
57         this.el.show_all();
58        // not sure why..
59        
60        
61        
62         while(Gtk.events_pending()) { 
63                 Gtk.main_iteration();
64         }       
65     }
66     public class Xcls_compile_view : Object
67     {
68         public Gtk.Box el;
69         private Xcls_ValaCompileResults  _this;
70
71
72             // my vars (def)
73
74         // ctor
75         public Xcls_compile_view(Xcls_ValaCompileResults _owner )
76         {
77             _this = _owner;
78             _this.compile_view = this;
79             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
80
81             // my vars (dec)
82
83             // set gobject values
84             this.el.homogeneous = false;
85             var child_0 = new Xcls_ScrolledWindow3( _this );
86             child_0.ref();
87             this.el.pack_end (  child_0.el , true,true,0 );
88         }
89
90         // user defined functions
91     }
92     public class Xcls_ScrolledWindow3 : Object
93     {
94         public Gtk.ScrolledWindow el;
95         private Xcls_ValaCompileResults  _this;
96
97
98             // my vars (def)
99
100         // ctor
101         public Xcls_ScrolledWindow3(Xcls_ValaCompileResults _owner )
102         {
103             _this = _owner;
104             this.el = new Gtk.ScrolledWindow( null, null );
105
106             // my vars (dec)
107
108             // set gobject values
109             this.el.hexpand = true;
110             var child_0 = new Xcls_sourceview( _this );
111             child_0.ref();
112             this.el.add (  child_0.el  );
113
114             // init method
115
116             {
117              this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
118              
119             
120             }
121         }
122
123         // user defined functions
124     }
125     public class Xcls_sourceview : Object
126     {
127         public Gtk.SourceView el;
128         private Xcls_ValaCompileResults  _this;
129
130
131             // my vars (def)
132
133         // ctor
134         public Xcls_sourceview(Xcls_ValaCompileResults _owner )
135         {
136             _this = _owner;
137             _this.sourceview = this;
138             this.el = new Gtk.SourceView();
139
140             // my vars (dec)
141
142             // set gobject values
143             this.el.show_line_numbers = true;
144
145             // init method
146
147             {
148             
149                 var description =   Pango.FontDescription.from_string("monospace");
150                 description.set_size(8000);
151                 this.el.override_font(description);
152             
153             
154             }
155         }
156
157         // user defined functions
158     }
159
160
161
162 }