Dear all, I have a Tkinter application which is then packaged into an App using py2app.
I (and various others) have a problem that Windows don't lift to visibility under MacOSX Lion, at least using Python 2.7.2, Tk8.5 Lion 10.7.4 and py2app 2.6.4 IF argv_emulation is set to True This can be demonstatrated by the following scripts: File 1: test.py --------------------- from Tkinter import * tk = Tk() fr=Frame(tk, height=400, width=400) fr.pack() def openWin(): t=Toplevel(tk) Button(t, text="Close", command=lambda w=t: w.destroy()).pack() for i in range(4): for j in range(4): Button(fr, text="Open", command=openWin).grid(row=i, column=j) tk.mainloop() -------------------- File 2: PackageMaker.py --------------------- rom setuptools import setup import sys sys.argv=[sys.argv[0]] sys.argv.append("py2app") setup( app=['test.py'], data_files=[], options={'py2app': {'argv_emulation': True, 'resources': []}}, setup_requires=['py2app'], ) -------------------- Now, the test.py script works fine when executed from Idle or using pythonw. It just doesn't work as expected when packaged as an executable by py2app. Windows do not appear when the buttons are pressed. (but note: the application does work when run from a console using: test.app/Contents/MacOS/test ) Kevin Walzer verified the behaviour I report on his machine. He found that if you set argv_emulation to False, the program worked as expected. NOW, I need argv_emulation, since a user might open my application by double clicking on a document associated with my program. I don't want to lose this functionality (which users are used to by now) just because of a bug. Now, I find it atrange that a bit of code which deals with passing command line args to the program should mess up Tkinter's windowing, just doesn't make sense. Anybody know of a workaround? Or is this a true bug that can be fixed? Mick O'Donnell
_______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG