refactor notes code
parent
e461c17a04
commit
ac1eede71a
|
@ -168,6 +168,19 @@ class ControlView : DrawingArea {
|
|||
|
||||
}
|
||||
|
||||
class NotesView : TextView {
|
||||
TextBuffer buffer;
|
||||
|
||||
public NotesView() {
|
||||
buffer = new TextBuffer(null);
|
||||
set_buffer(buffer);
|
||||
}
|
||||
|
||||
public void set_text(string text) {
|
||||
buffer.set_text(text, (int) text.length);
|
||||
}
|
||||
}
|
||||
|
||||
class ControlWindow : Window {
|
||||
public void button_clicked(string btn) {
|
||||
if(btn == "config")
|
||||
|
@ -192,8 +205,12 @@ class ControlWindow : Window {
|
|||
var toolbar = new ControlToolbar(document.get_n_pages());
|
||||
aspect.add(toolbar);
|
||||
|
||||
var notes = new NotesView();
|
||||
|
||||
hpaned.pack1(drawingarea, true, false);
|
||||
hpaned.pack2(new TextView(), false, true);
|
||||
hpaned.pack2(notes, false, true);
|
||||
|
||||
notes.set_text("put notes here...");
|
||||
|
||||
vbox.pack_start(hpaned, true, true, 0);
|
||||
vbox.pack_start(aspect, false, true, 0);
|
||||
|
|
|
@ -48,6 +48,10 @@ int main(string[] args) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
if(document.has_attachments()) {
|
||||
message("hey there are attachments!");
|
||||
}
|
||||
|
||||
/* Monitor class can be used like this
|
||||
Gdk.Display dp = Gdk.Display.get_default();
|
||||
Gdk.Screen screen = dp.get_screen(0);
|
||||
|
|
Loading…
Reference in New Issue