[Pygui] PyGUI on OSX using 100% cpu time

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Jul 6 03:39:01 CEST 2011


Erik Oomen wrote:

> What I noticed is that under OSX (10.6.8, 64bit) the CPU usage is 100%.

Yow, I hadn't noticed that!

It only seems to happen when showing a modal dialog, though.

One way to fix this is to add a 1msec delay in GUI/Cocoa/Application.py
>         time.sleep(0.001)
>         ns_event = ns_app.nextEventMatchingMask_untilDate_inMode_dequeue_(
>             NSAnyEventMask, None, ns_mode, True)
> 
> My question, Is this the appropriate way to fix this?

It'll do for now, but I'd like to find a better solution.
I need to look into why I'm using that method in the first
place instead of just calling runModalForWindow().

-- 
Greg


More information about the Pygui mailing list