1 static Xcls_ValaCompileResults _ValaCompileResults;
3 public class Xcls_ValaCompileResults : Object
6 private Xcls_ValaCompileResults _this;
8 public static Xcls_ValaCompileResults singleton()
10 if (_ValaCompileResults == null) {
11 _ValaCompileResults= new Xcls_ValaCompileResults();
13 return _ValaCompileResults;
15 public Xcls_compile_view compile_view;
16 public Xcls_sourceview sourceview;
20 public Xcls_MainWindow window;
24 public Xcls_ValaCompileResults()
27 this.el = new Gtk.Popover();
34 this.el.width_request = 600;
35 this.el.height_request = 400;
36 this.el.position = Gtk.PositionType.TOP;
37 new Xcls_compile_view( _this );
38 this.el.set_child ( _this.compile_view.el );
41 // user defined functions
42 public void show ( Gtk.Widget onbtn, bool reset) {
43 var win = this.window.el;
44 var w = win.get_width();
45 var h = win.get_height();
47 // left tree = 250, editor area = 500?
49 var new_w = int.min(750, w-100);
50 if (new_w > (w-100)) {
53 this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));
54 if (this.el.parent == null) {
55 this.el.set_parent(win);
57 // Gtk.Allocation rect;
58 //onbtn.get_allocation(out rect);
59 //this.el.set_pointing_to(rect);
65 var buf = (GtkSource.Buffer)this.sourceview.el.get_buffer();
73 public void addLine (string str) {
77 var buf = (GtkSource.Buffer)this.sourceview.el.get_buffer();
79 buf.get_end_iter (out iter);
80 buf.insert(ref iter, str, str.length);
82 buf.get_end_iter (out iter);
83 this.sourceview.el.scroll_to_iter(iter, 0.0f, true, 0.0f, 1.0f);
86 public class Xcls_compile_view : Object
89 private Xcls_ValaCompileResults _this;
95 public Xcls_compile_view(Xcls_ValaCompileResults _owner )
98 _this.compile_view = this;
99 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
103 // set gobject values
104 this.el.homogeneous = false;
105 this.el.hexpand = true;
106 this.el.vexpand = true;
107 var child_1 = new Xcls_ScrolledWindow3( _this );
109 this.el.append( child_1.el );
112 // user defined functions
114 public class Xcls_ScrolledWindow3 : Object
116 public Gtk.ScrolledWindow el;
117 private Xcls_ValaCompileResults _this;
123 public Xcls_ScrolledWindow3(Xcls_ValaCompileResults _owner )
126 this.el = new Gtk.ScrolledWindow();
130 // set gobject values
131 this.el.hexpand = true;
132 this.el.vexpand = true;
133 new Xcls_sourceview( _this );
134 this.el.child = _this.sourceview.el;
139 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
145 // user defined functions
147 public class Xcls_sourceview : Object
149 public GtkSource.View el;
150 private Xcls_ValaCompileResults _this;
154 public Gtk.CssProvider css;
157 public Xcls_sourceview(Xcls_ValaCompileResults _owner )
160 _this.sourceview = this;
161 this.el = new GtkSource.View();
165 // set gobject values
166 this.el.name = "compile-results-view";
167 this.el.editable = false;
168 this.el.show_line_numbers = false;
169 this.el.hexpand = true;
170 this.el.vexpand = true;
176 this.css = new Gtk.CssProvider();
178 this.css.load_from_string(
179 "#compile-results-view { font: 10px monospace ;}"
182 Gtk.StyleContext.add_provider_for_display(
183 this.el.get_display(),
185 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
192 // user defined functions