Re: nanothreads: Want to use them from within wxPython app



F. GEIGER wrote:
> I've def'ed a handler for EVT_IDLE in the app's main frame. There I'd like
> to call the nanothreads' __iter__ method, somehow.
>
> When I copy the __iter__ method into a, say, runOnce() method and call the
> next() method of the generator returned by runOnce(), it works. But I can't
> get at the __iter__ method, which is already there and therefore should be
> used instead of messing up nanothreads with changes of mine.
>
> Any hint welcome

The latest version of nanothreads is now in the fibranet package, which
you can download from the cheeseshop:

http://cheeseshop.python.org/pypi/FibraNet

To iterate nanothreads from wx, I call the nanothreads.poll() function
from the EVT_IDLE handler, making sure that I call event.RequestMore()
from within the handler, to iterate nanothreads as fast as possible.

HTH, Simon WIttber.

.



Relevant Pages

  • Re: nanothreads: Want to use them from within wxPython app
    ... >> I've def'ed a handler for EVT_IDLE in the app's main frame. ... Good hint, thanks, I always tend to forget that. ... to iterate nanothreads as fast as possible. ... Franz GEIGER ...
    (comp.lang.python)
  • Re: radio button question
    ... I created a KeyDown event handler and it works with one ... Radio buttons can be tricky. ... ..Net frame does) and disable the frame before manipulating the ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: SetFocus on a userform Does Not Work
    ... txtClientNumber_Exit handler. ... When the entry is invalid, ... >textboxes inside the frame. ... > Dim StrClientName As String ...
    (microsoft.public.word.vba.general)
  • RE: Code to "click" a button -- is this possible?
    ... Check that you already have the button's handler. ... When a user navigates through the right frame, ... I need the refresh to occur after. ... "invoke" the onclick event. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Lost WM_COMMAND message?
    ... the frame window is created, I would feel more comfortable doing a PostMessage ... that the message is lost. ... If it arrived, it is not lost, but then you have to make sure you have a handler ...
    (microsoft.public.vc.mfc)