[Gtk-sharp-list] GTK Window Events

Christopher David Howie me at chrishowie.com
Mon Aug 9 01:04:31 EDT 2010


On 08/08/2010 11:03 PM, jtemple wrote:
> I modified the code in my application but OnShown is stil not getting
> fired.

It's possible that GTK+ is consuming this event and marking it handled
before your code gets a chance to see it.  To remedy this, you have two
options, but this is the cleaner of the two:

Remove the signal binding in MD.  Then override the existing OnShown
event defined by Gtk.Window.  First have your code run, then before the
event returns, make sure you call "base.OnShown()" so that the Window
gets to handle the event too.  This is considered the correct,
object-oriented approach.

The other, less clean option is to add the "[GLib.ConnectBefore]"
attribute to your method, which will instruct the binding to insert your
event handler before the Window object's own handler.  But this would be
an evil, nasty thing to do.  :)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers

If you correspond with me on a regular basis, please read this document:
http://www.chrishowie.com/email-preferences/

PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5

------------------------------------------------------------------------
                    IMPORTANT INFORMATION/DISCLAIMER

This document should be read only by those persons to whom it is
addressed.  If you have received this message it was obviously addressed
to you and therefore you can read it.

Additionally, by sending an email to ANY of my addresses or to ANY
mailing lists to which I am subscribed, whether intentionally or
accidentally, you are agreeing that I am "the intended recipient," and
that I may do whatever I wish with the contents of any message received
from you, unless a pre-existing agreement prohibits me from so doing.

This overrides any disclaimer or statement of confidentiality that may
be included on your message.


More information about the Gtk-sharp-list mailing list