[Gtk-sharp-list] Add a menu to a treeview
Raúl Moratalla
raul.moratalla@ono.com
Thu, 29 Jul 2004 16:40:32 +0200
El jue, 29-07-2004 a las 01:15, Fredrik Nilsson escribió:
> 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
>
I don't know if I did something wrong but it doesn't work. I didn't know
how to handle the right click, but now I know it :)
I also added the handler for the PopupMenu event (I think that it is
activated pressing Alt+F10) but it neither works.
I should be doing something wrong.
Any ideas?
Raúl
PS: A guy from mono-hispano have the same problem too.