refactor notes code

master
Sebastian Reichel 2012-01-17 15:04:31 +01:00
parent e461c17a04
commit ac1eede71a
2 changed files with 22 additions and 1 deletions

View File

@ -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 { class ControlWindow : Window {
public void button_clicked(string btn) { public void button_clicked(string btn) {
if(btn == "config") if(btn == "config")
@ -192,8 +205,12 @@ class ControlWindow : Window {
var toolbar = new ControlToolbar(document.get_n_pages()); var toolbar = new ControlToolbar(document.get_n_pages());
aspect.add(toolbar); aspect.add(toolbar);
var notes = new NotesView();
hpaned.pack1(drawingarea, true, false); 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(hpaned, true, true, 0);
vbox.pack_start(aspect, false, true, 0); vbox.pack_start(aspect, false, true, 0);

View File

@ -48,6 +48,10 @@ int main(string[] args) {
return 1; return 1;
} }
if(document.has_attachments()) {
message("hey there are attachments!");
}
/* Monitor class can be used like this /* Monitor class can be used like this
Gdk.Display dp = Gdk.Display.get_default(); Gdk.Display dp = Gdk.Display.get_default();
Gdk.Screen screen = dp.get_screen(0); Gdk.Screen screen = dp.get_screen(0);