From be6b74d1047653c23c666d11e6931878ec96bffc Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 21 Mar 2019 13:09:58 +0800 Subject: [PATCH] NewBranch.bjs NewBranch.vala --- NewBranch.bjs | 15 ++++++++++++ NewBranch.vala | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/NewBranch.bjs b/NewBranch.bjs index 39221333..13b83f92 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -540,6 +540,21 @@ "$ xns" : "Gtk" } ] + }, + { + "int height_request" : 400, + "* pack" : "pack_start,true,true,0", + "xtype" : "ScrolledWindow", + "$ xns" : "Gtk", + "items" : [ + { + "id" : "diff_view", + "* init" : " \n var description = Pango.FontDescription.from_string(\"monospace\");\n description.set_size(9000);\n this.el.override_font(description);\n var lm = Gtk.SourceLanguageManager.get_default();\n \n ((Gtk.SourceBuffer)(this.el.get_buffer())).set_language(\n lm.get_language(\"diff\")\n );", + "xtype" : "View", + "* pack" : "add", + "$ xns" : "GtkSource" + } + ] } ] } diff --git a/NewBranch.vala b/NewBranch.vala index 4276e91b..a2d2044e 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -45,6 +45,7 @@ public class NewBranch : Object public Xcls_devmodel devmodel; public Xcls_commit_message commit_message; public Xcls_createbtn createbtn; + public Xcls_diff_view diff_view; // my vars (def) public GitRepo? repo; @@ -2175,6 +2176,9 @@ public class NewBranch : Object var child_0 = new Xcls_Table52( _this ); child_0.ref(); this.el.pack_start ( child_0.el , false,false,0 ); + var child_1 = new Xcls_ScrolledWindow56( _this ); + child_1.ref(); + this.el.pack_start ( child_1.el , true,true,0 ); } // user defined functions @@ -2320,6 +2324,64 @@ public class NewBranch : Object } + public class Xcls_ScrolledWindow56 : Object + { + public Gtk.ScrolledWindow el; + private NewBranch _this; + + + // my vars (def) + + // ctor + public Xcls_ScrolledWindow56(NewBranch _owner ) + { + _this = _owner; + this.el = new Gtk.ScrolledWindow( null, null ); + + // my vars (dec) + + // set gobject values + this.el.height_request = 400; + var child_0 = new Xcls_diff_view( _this ); + child_0.ref(); + this.el.add ( child_0.el ); + } + + // user defined functions + } + public class Xcls_diff_view : Object + { + public Gtk.SourceView el; + private NewBranch _this; + + + // my vars (def) + + // ctor + public Xcls_diff_view(NewBranch _owner ) + { + _this = _owner; + _this.diff_view = this; + this.el = new Gtk.SourceView(); + + // my vars (dec) + + // init method + + var description = Pango.FontDescription.from_string("monospace"); + description.set_size(9000); + this.el.override_font(description); + var lm = Gtk.SourceLanguageManager.get_default(); + + ((Gtk.SourceBuffer)(this.el.get_buffer())).set_language( + lm.get_language("diff") + ); + } + + // user defined functions + } + + } -- 2.39.2