[Gtk-sharp-list] Re: ButtonPressEvent in 0.15

Ecmel Ercan ecmel@ercansoy.com
Tue, 13 Jan 2004 19:14:55 +0200


Thank you very much for the answer.

I tried that, I mean I subclassed the TreeView and overridden the
OnButtonPressEvent as:

    protected override bool OnButtonPressEvent (ref Gdk.EventButton evnt)
    {
        base.OnButtonPressEvent (ref evnt);
        return false;
    }

The problem is:

1. If the base method is called, the program segfaults
2. If the base method is not called, default TreeView navigation through
mouse does not work.

So, what is the easiest way to attach a context menu activated by
right-click of a mouse to a TreeView?

Thanks for your attention.





On Tue, 13 Jan 2004 11:04:24 -0600, Mike Kestner wrote:

> On Mon, 2004-01-12 at 16:32, Ecmel Ercan wrote:
> 
>> As far as I can tell, ButtonPressEvent is defined in Widget and handled in
>> TreeView but I need to connect to this event in order to do extra things
>> in Double-click and Right-click (e.g. pop up a menu).
> 
> This question is coming up often enough that I've added it to the FAQ:
> 
> http://gtk-sharp.sourceforge.net/faq.html#3.3