3
using System.Runtime.InteropServices;
10
namespace Tomboy.PrintNotes
12
public class PrintNotesNoteAddin : NoteAddin
14
Gtk.ImageMenuItem item;
16
public override void Initialize ()
18
item = new Gtk.ImageMenuItem (Catalog.GetString ("Print"));
19
item.Image = new Gtk.Image (Gtk.Stock.Print, Gtk.IconSize.Menu);
20
item.Activated += PrintButtonClicked;
22
AddPluginMenuItem (item);
25
public override void Shutdown ()
27
// Disconnect the event handlers so
28
// there aren't any memory leaks.
29
item.Activated -= PrintButtonClicked;
32
public override void OnNoteOpened ()
37
[DllImport("libtomboy")]
38
static extern void gedit_print (IntPtr text_view_handle);
41
// Handle Print menu item Click
44
void PrintButtonClicked (object sender, EventArgs args)
46
gedit_print (Note.Window.Editor.Handle);