1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
public class LogDialog : Gtk.Window {
public LogDialog () {
this.title = "Debby Logs";
this.border_width = 5;
this.set_default_size (550, 400);
create_widgets ();
this.show_all ();
}
public void create_widgets () {
// Box:
Gtk.Box box = new Gtk.Box (Gtk.Orientation.VERTICAL, 1);
this.add (box);
// A ScrolledWindow:
Gtk.ScrolledWindow scrolled = new Gtk.ScrolledWindow (null, null);
box.pack_start (scrolled, true, true, 0);
// The TextView:
Gtk.TextView view = new Gtk.TextView ();
view.set_wrap_mode (Gtk.WrapMode.WORD);
home = Environment.get_home_dir ();
string text;
FileUtils.get_contents (home + "/.debby.log", out text);
view.buffer.text = text;
view.editable = false;
scrolled.add (view);
}
}
|