[Gtk-sharp-list] Add a menu to a treeview

Draek draek@localhost.localdomain
Thu, 05 Aug 2004 21:22:48 -0600


Wjat is the [ConnectBefore] statement before the function header? I have
not seen this used in C# before, and I'm curious :)

Is it just a comment for the example in the email or is that code?

Thanks in advance,
Phil

On Thu, 2004-07-29 at 11:35, Raúl Moratalla wrote:
> > 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
> 
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list