[Gtk-sharp-list] "correct" way of checking for right click on a button?

Jesper K. Pedersen linux at famped.dk
Mon Dec 10 07:01:19 EST 2007


In connection with a piece of software I am trying to write I need to
be able to check when a button is right-clicked.

For the GUI layout I am using Glade-2

I see from the GTK manual that buttons support the "pressed" event and
I was going to use that .

From the manual of the button pressed even it states that the event
function takes two arguments like this example :

private void fkey_pressed (object o, ButtonPressEventArgs a)

Unfortunately Glade tries to load the pressed event as "Eventargs"
giving this runtime error :

Unhandled Exception: Glade.HandlerNotFoundException: The handler for
the event Pressed should take '(System.Object,System.EventArgs)', but
the signature of the provided handler ('fkey_pressed') is
'(System.Object,Gtk.ButtonPressEventArgs)'

Anyone have an example to show the correct way of doing this I would
greatly appreciate if you can direct me to it.

Best regards
Jesper KP


More information about the Gtk-sharp-list mailing list