From bergs at janelia.hhmi.org Tue Aug 13 02:13:20 2013 From: bergs at janelia.hhmi.org (Berg, Stuart) Date: Tue, 13 Aug 2013 00:13:20 +0000 Subject: [Pythonmac-SIG] py2app + pyqt: Differences between command-line and double-click In-Reply-To: <2C0731DD-AB01-4C8E-88E4-3703C96CF072@mac.com> References: <2C0731DD-AB01-4C8E-88E4-3703C96CF072@mac.com> Message-ID: Hi Ronald, It took me a while to follow up on this thread I started a few months ago because I wanted to find a minimal test case that illustrates my problem. Now I've got one. Apparently the PyQt spashscreen doesn't behave correctly when I use the py2app "argv_emulation" option. To save you from digging through your email for the previous posts, I'll summarize my issue again: - I use py2app to bundle my app, which is implemented with PyQt4 (qt-4.8.3, pyqt-4.9.5). - I want to show a QSplashScreen when my app starts up, and hide it when the main window is shown. - When I double-click my app bundle: -- There is a brief delay -- The splash screen appears -- The main window does not appear. -- At this point, I can summon the main window into existence by using command-tab to switch away from the app and then back again. - I get correct splash screen behavior if I launch the app from the command line via MyBundle.app/Contents/MacOS/myapp I noticed that the odd behavior happens when I use the "argv_emulation" option. Here's a minimal example that shows the incorrect behavior on my machine. To see correct behavior, comment out the 'argv_emulation' option in setup.py. If necessary, I can probably use a workaround to avoid argv_emulation, but if there is a quick fix for this, I'd love to know about it. Thanks, Stuart # bash commands to run: $ python setup.py py2app $ open dist/splashtest.app # incorrect splash screen behavior $ open dist/splashtest.app/Contents/MacOS/splashtest # Correct behavior ############## ### splashtest.py import sys, time from PyQt4.QtGui import QPixmap, QSplashScreen, QApplication, QMainWindow app = QApplication([]) # Show a (blank) splash screen splash = QSplashScreen( QPixmap(300, 200) ) splash.show() app.processEvents() time.sleep(1) # Create & show the main window window = QMainWindow() window.show() window.raise_() # Close the splash screen splash.finish(window) sys.exit( app.exec_() ) ############## # setup.py from setuptools import setup, find_packages setup( app=['splashtest.py'], options={ 'py2app': { 'argv_emulation': True, 'includes':['PyQt4.QtCore','PyQt4.QtGui' ] } }, setup_requires=['py2app'] ) From micko at wagsoft.com Thu Aug 15 09:19:47 2013 From: micko at wagsoft.com (Michael O'Donnell) Date: Thu, 15 Aug 2013 09:19:47 +0200 Subject: [Pythonmac-SIG] py2app + pyqt: Differences between command-line and double-click In-Reply-To: References: <2C0731DD-AB01-4C8E-88E4-3703C96CF072@mac.com> Message-ID: Hi Stuart, I have been suffering similar problems since MacOSX changed the way they handle windows, a couple of versions back. See: http://mail.python.org/pipermail/tkinter-discuss/2012-May/003161.html The problem there also included the argv_emulation flag, and setting this to false fixed the problem. If you need argv_emulation=True, then put some code in to iconify/deiconify the window (maybe followed by a lift). May result in the window flashing, but at least it will be workable to your users. I have the following in my code for my toplevel window: self.lift() if sys.platform =="darwin": self.iconify() self.update() self.deiconify() Mick On 13 August 2013 02:13, Berg, Stuart wrote: > Hi Ronald, > > It took me a while to follow up on this thread I started a few months ago > because I wanted to find a minimal test case that illustrates my problem. > Now I've got one. Apparently the PyQt spashscreen doesn't behave > correctly when I use the py2app "argv_emulation" option. > > To save you from digging through your email for the previous posts, I'll > summarize my issue again: > > - I use py2app to bundle my app, which is implemented with PyQt4 > (qt-4.8.3, pyqt-4.9.5). > - I want to show a QSplashScreen when my app starts up, and hide it when > the main window is shown. > - When I double-click my app bundle: > -- There is a brief delay > -- The splash screen appears > -- The main window does not appear. > -- At this point, I can summon the main window into existence by using > command-tab to switch away from the app and then back again. > - I get correct splash screen behavior if I launch the app from the > command line via MyBundle.app/Contents/MacOS/myapp > > I noticed that the odd behavior happens when I use the "argv_emulation" > option. Here's a minimal example that shows the incorrect behavior on my > machine. To see correct behavior, comment out the 'argv_emulation' option > in setup.py. > > If necessary, I can probably use a workaround to avoid argv_emulation, but > if there is a quick fix for this, I'd love to know about it. > > Thanks, > Stuart > > # bash commands to run: > $ python setup.py py2app > $ open dist/splashtest.app # incorrect splash screen behavior > $ open dist/splashtest.app/Contents/MacOS/splashtest # Correct behavior > > ############## > ### splashtest.py > import sys, time > from PyQt4.QtGui import QPixmap, QSplashScreen, QApplication, QMainWindow > > app = QApplication([]) > > # Show a (blank) splash screen > splash = QSplashScreen( QPixmap(300, 200) ) > splash.show() > app.processEvents() > > time.sleep(1) > > # Create & show the main window > window = QMainWindow() > window.show() > window.raise_() > > # Close the splash screen > splash.finish(window) > > sys.exit( app.exec_() ) > > ############## > # setup.py > from setuptools import setup, find_packages > setup( > app=['splashtest.py'], > options={ 'py2app': { 'argv_emulation': True, > 'includes':['PyQt4.QtCore','PyQt4.QtGui' ] } }, > setup_requires=['py2app'] > ) > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.brett at gmail.com Sat Aug 24 06:39:02 2013 From: matthew.brett at gmail.com (Matthew Brett) Date: Fri, 23 Aug 2013 21:39:02 -0700 Subject: [Pythonmac-SIG] New release of bdist_mpkg Message-ID: Hi, I just did a new release of bdist_mpkg: https://pypi.python.org/pypi/bdist_mpkg/ The main new feature is Python 3 compatibility: https://github.com/matthew-brett/bdist_mpkg/blob/master/Changelog Thanks to Bob Ippolito for the original code and Ronald Oussoren for taking care of it. Please do let me know if you hit any bugs or misfeatures, Cheers, Matthew From ronaldoussoren at mac.com Mon Aug 26 13:42:30 2013 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 26 Aug 2013 13:42:30 +0200 Subject: [Pythonmac-SIG] [Pyobjc-dev] Towards PyObjC 3.0 In-Reply-To: <245FA66F-1231-4480-9FE1-956946A214D4@mac.com> References: <245FA66F-1231-4480-9FE1-956946A214D4@mac.com> Message-ID: <700039AB-02C9-4033-87D2-6326E06C37D8@mac.com> On 4 Jul, 2013, at 17:08, Ronald Oussoren wrote: > > My self-imposed dead-line for a 3.0 release is "before OSX 10.9 is released", that's the easiest way to avoid getting carried away with wrapping all new APIs in OSX 10.9 and delaying the release even further. That seems to be overly optimistic on my part, I've done almost no work on PyObjC since my previous mail due to lack of time. Ronald