Changed sample project to show line numbers in sourceview

Just to make it a bit more obvious that the widget is a SourceView and
not a TextView.
This commit is contained in:
Drew Holzworth 2020-07-13 13:04:02 +10:00
parent 27125e5984
commit 6d3c0cf744
No known key found for this signature in database
GPG Key ID: 931DFD9C2A605512

View File

@ -16,7 +16,7 @@ namespace Samples
private Box _boxContent;
private TreeStore _store;
private Dictionary<string, (Type type, Widget widget)> _items;
private TextView _textViewCode;
private SourceView _textViewCode;
private Notebook _notebook;
public MainWindow() : base(WindowType.Toplevel)
@ -56,7 +56,10 @@ namespace Samples
_notebook.AppendPage(scroll1, new Label { Text = "Data", Expand = true });
var scroll2 = new ScrolledWindow();
_textViewCode = new SourceView();
_textViewCode.ShowLineNumbers = true;
_textViewCode.Margin = 3;
scroll2.Child = _textViewCode;
_notebook.AppendPage(scroll2, new Label { Text = "Code", Expand = true });