[Pygui] PyGUI on OSX using 100% cpu time

Erik Oomen erik.oomen at zepcam.com
Tue Jul 5 21:25:04 CEST 2011


I've came across pygui a few days ago and it seems quite useful.  What I noticed is that under OSX (10.6.8, 64bit) the CPU usage is 100%. (for one core that is).

The NagBox as found in the Demo's directory is an example of this.  One way to fix this is to add a 1msec delay in GUI/Cocoa/Application.py in function handle_next_event just before the ns_app.nextEventMatchingMask_untilDate_inMode_dequeue_ call:
        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? 

Erik.


More information about the Pygui mailing list