diff options
author | Stefano Karapetsas <[email protected]> | 2014-01-30 15:58:17 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2014-01-30 15:58:17 +0100 |
commit | c8a85a6aa040c1d2505b957af4cfb4bd39466504 (patch) | |
tree | 1d60e06e4504a25bf00918a3ee81e847af72bce1 /stickynotes/stickynotes.c | |
parent | d15349379583695063e692010bdb44e9974c3f18 (diff) | |
download | mate-applets-c8a85a6aa040c1d2505b957af4cfb4bd39466504.tar.bz2 mate-applets-c8a85a6aa040c1d2505b957af4cfb4bd39466504.tar.xz |
stickynotes: Add undo/redo feature
Using GtkSourceView instead of GtkTextView
This adds new dependency to package to build this applet
Closes #17
https://github.com/mate-desktop/mate-applets/issues/17
Diffstat (limited to 'stickynotes/stickynotes.c')
-rw-r--r-- | stickynotes/stickynotes.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/stickynotes/stickynotes.c b/stickynotes/stickynotes.c index d38aee3f..bb80dcf3 100644 --- a/stickynotes/stickynotes.c +++ b/stickynotes/stickynotes.c @@ -21,10 +21,18 @@ #include <libxml/parser.h> #include <X11/Xatom.h> #include <gdk/gdkx.h> +#include <gtk/gtk.h> #define WNCK_I_KNOW_THIS_IS_UNSTABLE 1 #include <libwnck/libwnck.h> #include <string.h> +#if GTK_CHECK_VERSION (3, 0, 0) +#include <gtksourceview/gtksource.h> +#else +#include <gtksourceview/gtksourceview.h> +#include <gtksourceview/gtksourcebuffer.h> +#endif + #include "stickynotes.h" #include "stickynotes_callbacks.h" #include "util.h" @@ -122,6 +130,8 @@ stickynote_new_aux (GdkScreen *screen, gint x, gint y, gint w, gint h) note->w_lock = GTK_WIDGET (gtk_builder_get_object (builder, "lock_button")); gtk_widget_add_events (note->w_lock, GDK_BUTTON_PRESS_MASK); + note->buffer = GTK_SOURCE_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(note->w_body))); + note->w_close = GTK_WIDGET (gtk_builder_get_object (builder, "close_button")); gtk_widget_add_events (note->w_close, GDK_BUTTON_PRESS_MASK); note->w_resize_se = GTK_WIDGET (gtk_builder_get_object (builder, "resize_se_box")); |