From erik.oomen at zepcam.com Tue Jul 5 21:25:04 2011 From: erik.oomen at zepcam.com (Erik Oomen) Date: Tue, 5 Jul 2011 21:25:04 +0200 Subject: [Pygui] PyGUI on OSX using 100% cpu time Message-ID: <1635DA65-B69B-4BC3-ACE9-2A36E8D9F653@zepcam.com> 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. From greg.ewing at canterbury.ac.nz Wed Jul 6 03:39:01 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Wed, 06 Jul 2011 13:39:01 +1200 Subject: [Pygui] PyGUI on OSX using 100% cpu time In-Reply-To: <1635DA65-B69B-4BC3-ACE9-2A36E8D9F653@zepcam.com> References: <1635DA65-B69B-4BC3-ACE9-2A36E8D9F653@zepcam.com> Message-ID: <4E13BCB5.7080400@canterbury.ac.nz> 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 From erik.oomen at zepcam.com Wed Jul 6 13:24:51 2011 From: erik.oomen at zepcam.com (Erik Oomen) Date: Wed, 6 Jul 2011 13:24:51 +0200 Subject: [Pygui] PyGUI on OSX using 100% cpu time In-Reply-To: <4E13BCB5.7080400@canterbury.ac.nz> References: <1635DA65-B69B-4BC3-ACE9-2A36E8D9F653@zepcam.com> <4E13BCB5.7080400@canterbury.ac.nz> Message-ID: <8A10CB1B-8DFE-4837-A57A-4FA7D844E788@zepcam.com> > 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(). > This seems to work just as good: import Foundation ns_distant_future = Foundation.NSDate.distantFuture() ns_event = ns_app.nextEventMatchingMask_untilDate_inMode_dequeue_( NSAnyEventMask, ns_distant_future, ns_mode, True) From greg.ewing at canterbury.ac.nz Thu Jul 7 01:11:16 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Thu, 07 Jul 2011 11:11:16 +1200 Subject: [Pygui] PyGUI on OSX using 100% cpu time In-Reply-To: <8A10CB1B-8DFE-4837-A57A-4FA7D844E788@zepcam.com> References: <1635DA65-B69B-4BC3-ACE9-2A36E8D9F653@zepcam.com> <4E13BCB5.7080400@canterbury.ac.nz> <8A10CB1B-8DFE-4837-A57A-4FA7D844E788@zepcam.com> Message-ID: <4E14EB94.40200@canterbury.ac.nz> Erik Oomen wrote: > This seems to work just as good: > import Foundation > ns_distant_future = Foundation.NSDate.distantFuture() > ns_event = ns_app.nextEventMatchingMask_untilDate_inMode_dequeue_( > NSAnyEventMask, ns_distant_future, ns_mode, True) Aha! I got completely the wrong idea about what the "expirationDate" parameter meant when I skimmed the docs the first time -- I thought it was somehow being compared with the timestamps on the events. If they'd just called it "timeout" or something I would have understood... grr. Anyhow, thanks, and I'll incorporate this fix ASAP. -- Greg From greg.ewing at canterbury.ac.nz Sat Jul 16 09:25:15 2011 From: greg.ewing at canterbury.ac.nz (Greg Ewing) Date: Sat, 16 Jul 2011 19:25:15 +1200 Subject: [Pygui] ANN: PyGUI 2.5.3 Message-ID: <4E213CDB.9010102@canterbury.ac.nz> PyGUI 2.5.3 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Clipboard access now implemented on MacOSX, plus a few bug fixes. What is PyGUI? -------------- PyGUI is a cross-platform GUI toolkit designed to be lightweight and have a highly Pythonic API. -- Gregory Ewing greg.ewing at canterbury.ac.nz http://www.cosc.canterbury.ac.nz/greg.ewing/ From rchenard at gmail.com Sat Jul 23 17:58:07 2011 From: rchenard at gmail.com (=?ISO-8859-1?Q?Renaud_Ch=E9nard?=) Date: Sat, 23 Jul 2011 17:58:07 +0200 Subject: [Pygui] PyGUI on Ubuntu11.04 Message-ID: Hello, I've tried the PyGUI librairy on Windows XP and i've find it very well made. I've tried to use it on the latest Ubuntu 11.04, and i was dissapointed because none of the examples was working without returning some errors. The problem is that on Ubuntu 11.04, the current version of PyGTK is the 2.22.0-0ubuntu1, and the PyGUI website say that it has only been test on the version 2.14.0. Is there an upgrade of PyGui planned thus it can work on PyGTK 2.22 ? Thanks by advance. Renaud -------------- next part -------------- An HTML attachment was scrubbed... URL: