I have a Gtk scrolled window that I'm trying to attach a PopupMenuHandler function too like so:
this.scrolledwindow1.PopupMenu += HandlePopupMenu;
and the HandlePopupMenu looks like so:
[GLib.ConnectBefore]
public void HandlePopupMenu(object o, PopupMenuArgs args)
{
Console.WriteLine("test");
Gtk.Menu mbox = new Gtk.Menu();
Gtk.MenuItem Test = new Gtk.MenuItem("test");
Test.Activated += delegate(object sender, EventArgs e) {
Console.WriteLine("test");
};
mbox.Append(Test);
mbox.ShowAll();
mbox.Popup();
}
My problem is that this event never gets called when I right click on the scrolled window. which I'm assuming it should based on this. There is only one other event handling the ScrollEvent, and nothing handling keyboard or mouse buttons. Can anybody tell my why this isn't working?