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 <be...@janelia.hhmi.org> 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@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > >
_______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG