[Gtk-sharp-list] Add a menu to a treeview
Raśl Moratalla
raul.moratalla@ono.com
Thu, 29 Jul 2004 19:35:36 +0200
> Hi again ;)
>
> Let's see if I can help you once again.... :)
>
> Define this signal to the treeview:
>
> treeview1.ButtonPressEvent += OnTreeview1ButtonPressEvent
>
> The Signalhandler looks like this:
>
> [ConnectBefore]
> public void OnTreeview1ButtonPressEvent (object o,
> ButtonPressEventArgs args)
> {
> Gdk.EventButton eb = args.Event;
>
> if (eb.Button == 3) { // Right click
> // pop up menu here...
>
> Console.WriteLine ("Right click");
> }
> }
>
>
> /Fredrik
>
> _______________________________________________
> Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
Hi Fredrik, as I made a copy and paste of your example and I didn't read
it before it didn't work.
I should change one line by this:
treeview1.ButtonPressEvent += new ButtonPressEventHandler(test)
Now it works without any problem. Thanks for your help.
Regards,
Raśl