[IronPython] Users Digest, Vol 59, Issue 1 /how to work with delegates in IronPython/

Michael Foord fuzzyman at voidspace.org.uk
Tue Jun 2 11:32:03 CEST 2009


Vadim Khaskel wrote:
> Michael,
>
> here is my scenario:
>
> I have a list - messageBuffer that captures messages. Once this list 
> gets a new message, event generated and combobox ads
>
> a new item.
>
> based on your example
>
> my combobox will do: self._comboBoxA.Event += function
>
> Is this just "Event" or any specific event, I understand that you 
> wrote it in general form.
>

You have to add in place (+=) to the specific event you want to handle. 
If you want to watch a 'list' (of some sort) and perform an action on 
the combobox you will need to listen for an event on the list.

What specific class is the list you intend to use? If you find the MSDN 
documentation for that class it will show you all the events available.

Michael Foord


> thank you for response,
>
> Vadim
>
>
> Message: 1
> > Date: Sun, 31 May 2009 22:51:54 +0100
> > From: Michael Foord <fuzzyman at voidspace.org.uk>
> > Subject: Re: [IronPython] how to work with delegates in IronPython
> > To: Discussion of IronPython <users at lists.ironpython.com>
> > Message-ID: <4A22FBFA.3010407 at voidspace.org.uk>
> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> >
> > Vadim Khaskel wrote:
> > > Hello everybody,
> > >
> > > Could somebody help to setup simple delegate in IronPython.
> > >
> > > I just need to generate event when list structure gets filled with 
> data,
> >
> > The standard technique is:
> >
> > # check delegate signature
> > def function(sender, event):
> > # do something
> >
> > instance.Event += function
> >
> > What is the list event you want to hook up to?
> >
> > Thanks
> >
> > Michael Foord
> > >
> > > and update GUI element.
> > >
> > > thanks a lot,
> > >
> > > V.
> ------------------------------------------------------------------------
> Insert movie times and more without leaving Hotmail®. See how. 
> <http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009> 
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   


-- 
http://www.ironpythoninaction.com/




More information about the Ironpython-users mailing list