X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=blobdiff_plain;f=src%2FBuilder4%2FValaCompileResults.vala;h=65a8194e965e87a852e48576546c58b3671f23ab;hp=2d205de154e56175b34364a2048de2d6782cb9a7;hb=HEAD;hpb=af409ce36cd1f84f6bc752eb754cbb96dc483afe diff --git a/src/Builder4/ValaCompileResults.vala b/src/Builder4/ValaCompileResults.vala index 2d205de15..65a8194e9 100644 --- a/src/Builder4/ValaCompileResults.vala +++ b/src/Builder4/ValaCompileResults.vala @@ -13,8 +13,10 @@ public class Xcls_ValaCompileResults : Object return _ValaCompileResults; } public Xcls_compile_view compile_view; + public Xcls_sourceview sourceview; // my vars (def) + public Xcls_MainWindow window; public bool active; // ctor @@ -24,7 +26,7 @@ public class Xcls_ValaCompileResults : Object this.el = new Gtk.Popover( null ); // my vars (dec) - this.active = false; + this.active = true; // set gobject values this.el.width_request = 600; @@ -37,6 +39,49 @@ public class Xcls_ValaCompileResults : Object } // user defined functions + public void show ( Gtk.Widget onbtn, bool reset) { + int w, h; + + this.window.el.get_size(out w, out h); + + // left tree = 250, editor area = 500? + + var new_w = int.min(750, w-100); + if (new_w > (w-100)) { + new_w = w-100; + } + this.el.set_size_request( int.max(100, new_w), int.max(100, h-120)); + + + if (this.el.relative_to == null) { + this.el.set_relative_to(onbtn); + } + this.el.show_all(); + // not sure why.. + + if (reset) { + var buf = (Gtk.SourceBuffer)this.sourceview.el.get_buffer(); + buf.set_text("",0); + } + + while(Gtk.events_pending()) { + Gtk.main_iteration(); + } + + + + } + public void addLine (string str) { + var buf = (Gtk.SourceBuffer)this.sourceview.el.get_buffer(); + Gtk.TextIter iter; + buf.get_end_iter (out iter); + buf.insert(ref iter, str, str.length); + /// scroll.. + buf.get_end_iter (out iter); + this.sourceview.el.scroll_to_iter(iter, 0.0f, true, 0.0f, 1.0f); + + + } public class Xcls_compile_view : Object { public Gtk.Box el; @@ -81,7 +126,7 @@ public class Xcls_ValaCompileResults : Object // set gobject values this.el.hexpand = true; - var child_0 = new Xcls_SourceView4( _this ); + var child_0 = new Xcls_sourceview( _this ); child_0.ref(); this.el.add ( child_0.el ); @@ -96,7 +141,7 @@ public class Xcls_ValaCompileResults : Object // user defined functions } - public class Xcls_SourceView4 : Object + public class Xcls_sourceview : Object { public Gtk.SourceView el; private Xcls_ValaCompileResults _this; @@ -105,15 +150,17 @@ public class Xcls_ValaCompileResults : Object // my vars (def) // ctor - public Xcls_SourceView4(Xcls_ValaCompileResults _owner ) + public Xcls_sourceview(Xcls_ValaCompileResults _owner ) { _this = _owner; + _this.sourceview = this; this.el = new Gtk.SourceView(); // my vars (dec) // set gobject values - this.el.show_line_numbers = true; + this.el.editable = false; + this.el.show_line_numbers = false; // init method