[Gtk-sharp-list] How to use the method Gdk.Window.AddFilter ???
Frank Gutierrez Domínguez
f.gutierrez at lab.matcom.uh.cu
Mon May 23 15:14:45 EDT 2011
Im developing a custom widget in Gtk# and I need to capture the events
before they reach the widget, i.e. capture the system messages before the
widget raises the event.
The ones who have experience in Windows Forms would know there this is
accomplished through the IMessageFilter interface. In SWF normally we make
our custom Control inherit from IMessageFilter, then implement the
PreFilterMessage method and in the constructor we call
As Ive been able to understand searching through various lists and forums I
think this is done in GTK# through the method Gdk.Window.AddFilter wich gets
an instance of the FilterFunc delegate.
So, in my custom widget I override the OnRealized method and inside it I
call this.GdkWindow.AddFilter(new Gdk.FilterFunc(PreFilterMessage)).
Until there everything is fine, but the problem is in the implementation of
the PreFilterMessage method wich signature is
public Gdk.FilterReturn PreFilterMessage(IntPtr xEvent, Gdk.Event evnt)
According to the Monodocs the Gdk.Event has some useful properties I can use
to know what type of event Im dealing with, such as Gdk.Event.Type, but
when I try to access it, it always has the default Nothing value. Does
anybody knows how to work with this method? How can I actually get some
juice of it?
Please, I need this ASAP, cause its part of my grade thesis work.
Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gtk-sharp-list