[IronPython] How to make a gtk event?
dinov at microsoft.com
Wed Apr 13 18:34:16 CEST 2011
> Hey guys,
> I'm writing a program using using gtk# and I have a custom widget that I want
> to make an event for. Here is what an event looks like:
> >>> print self.mainwindow.Shown
> <IronPython.Runtime.Types.ReflectedEvent+BoundEvent object at
> So I seem to need to instantiate this type with my event name and trigger
> function somehow as parameters, but I don't know how. Any ideas?
The BoundEvent object supports in place addition and subtraction for adding/removing
the events and it'll accept any callable object on the right hand side. So you should just do
+= on shown, such as:
def handler(sender, args):
self.mainwindow.shown += handler
More information about the Ironpython-users