From: Paul C. <pau...@vu...> - 2007-11-29 21:54:02
|
-------- Original Message -------- Subject: Py2exe and wxPython Date: Wed, 28 Nov 2007 19:45:12 -0800 From: Paul Cornelius <pau...@vu...> Organization: VueMetrix To: py2...@li... All: I am having a strange problem with a py2exe/wxPython application and I'm hoping someone can point me in the right direction. I have been distributing a wxPython application with py2exe for some time, and have not encountered any difficulties until recently. I added a number of "ToolTips" to the application and was surprised to discover that the tool tips appear normally when I run the program from a command line with the Python interpreter, but they do not appear in the application when I package it for distribution with py2exe. To make matters even weirder, the behavior of the py2exe version differs across computers: on some computers the tool tips appear as they should, but on others they don't. In the Python interpreter environment they always appear. All computers are running Windows XP. I'm guessing this is some kind of Windows-related problem, but I don't even know where to look. I used "Dependency Walker" to investigate any differences in Windows .dll dependencies. When I run the same executable on two different machines, one where the tool tips work and one where they don't, I see 21 differences in the .dlls loaded, in their dates or version numbers. I can't use Dependency Walker to compare the .py and .exe versions on the same computer, which as far as I can tell are absolutely identical in behavior except for the ToolTips. What are the differences between a py2exe executable and the .py script from which it is built? How can such a subtle differences in behavior be explained? Here is the simplest program I can come up with that illustrates the problem: import wx class MainWindow(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1,"Test tool tips") butt = wx.Button(self,-1,"Press me") s = "Go ahead, make my day" butt.SetToolTip(wx.ToolTip(s)) self.Show(True) def runapp(): app = wx.PySimpleApp() MainWindow() app.MainLoop() runapp() And here is the setup.py script to build an .exe: import py2exe from distutils.core import setup win0 = { "script" : "tt.py", # tt.py is the filename of the above script } setup(version="0.0", description = "Test program for tool tips", windows = [win0], # options = {"py2exe": {"bundle_files" : 1,"optimize" : 2,"compressed" : 1}} ) The .py script shows ToolTips and the .exe doesn't. I can remove the comment before the last line and build again; that has no effect. I can build the .exe as a console application instead of a window application, and that also has no effect. Any help (or even expressions of commiseration) would be greatly appreciated. Paul Cornelius VueMetrix, Inc. |
From: Nerijus B. <ne...@us...> - 2007-12-03 02:30:05
|
On Thu, 29 Nov 2007 13:54:00 -0800 Paul Cornelius <pau...@vu...> wrote: > I am having a strange problem with a py2exe/wxPython application. > I added a number of > "ToolTips" to the application and was surprised to discover that the > tool tips appear normally when I run the program from a command line > with the Python interpreter, but they do not appear in the application > when I package it for distribution with py2exe. I have tested my app, and it displays tooltips when run under wine, win98 and XP. > To make matters even > weirder, the behavior of the py2exe version differs across computers: on > some computers the tool tips appear as they should, but on others they > don't. In the Python interpreter environment they always appear. All > computers are running Windows XP. > > I'm guessing this is some kind of Windows-related problem, but I don't > even know where to look. I used "Dependency Walker" to investigate any > differences in Windows .dll dependencies. When I run the same > executable on two different machines, one where the tool tips work and > one where they don't, I see 21 differences in the .dlls loaded, in their > dates or version numbers. I'd try to replace dll's until you find which one (or ones) is to blame. For example, http://wxpython.org/download.php says: If your tree controls have strange background colors, try loading this MS Common Controls Update as wxWidgets does something that causes a bug in one of the older versions to manifest itself. Another way to get this update is to install Internet Explorer or MS Office apps, so if the system has those already then you probably don't need to worry about this. There could be other updates needed for tooltips. Do your computers have the same service pack and updates? Regards, Nerijus |