Toolbar separator strangeness (py2exe)

Hi,

I have a wxPython app with a toolbar, and separators on the toolbar.

Under Windows XP the separators show up as blank spaces instead of vertical lines : fom browsing the list archives I gather this is nothing unusual, their behaviour is documented as inconsistent across platforms, even Windows platforms it seems :slight_smile:

The strange part is this : I have also installed py2exe and sucessfully created an executable from that app (*). But when I run that executable instead of the original python module, the vertical lines in the separators now show up... Anyone seen this before ?

(it is actually a hassle because I was foolishly _relying_ on that behaviour to use several separators as spacers - obviously I'm going to have to find something better :slight_smile:

(*) this is off-topic but just in case someone knows : my setup.py works except for including an icon in the executable. I've tried two methods found on the wxpython and py2exe wikis (icon_resources in setup.py and --icon on the command line) but both generate errors. Is this another XP problem ?

Thanks,
fp

Fred P wrote:

I have a wxPython app with a toolbar, and separators on the toolbar.

Under Windows XP the separators show up as blank spaces instead of vertical lines : fom browsing the list archives I gather this is nothing unusual, their behaviour is documented as inconsistent across platforms, even Windows platforms it seems :slight_smile:

The strange part is this : I have also installed py2exe and sucessfully created an executable from that app (*). But when I run that executable instead of the original python module, the vertical lines in the separators now show up... Anyone seen this before ?

If anyone's interested, here's more info on how (not why) this happens.

After posting I noticed it's not only the separators - the toolbar itself is different. Checking the code I saw that the CreateToolbar call (pasted from a sample) had the wx.TB_FLAT style set. When I run the Python module this is happily ignored, the toolbar has the classic, 3D raised buttons (and empty separators). When I run the executable I get the flat toolbar look with vertical lines.

Moreover, if I specify _no_ styles at all, I get the exact same results.

Curiouser and curiouser :slight_smile:

Hi,

I have a wxPython app with a toolbar, and separators on the toolbar.

Under Windows XP the separators show up as blank spaces instead of
vertical lines : fom browsing the list archives I gather this is nothing
unusual, their behaviour is documented as inconsistent across platforms,
even Windows platforms it seems :slight_smile:

The strange part is this : I have also installed py2exe and sucessfully
created an executable from that app (*). But when I run that executable
instead of the original python module, the vertical lines in the
separators now show up... Anyone seen this before ?

I haven't seen specifically this before, but I suspect it's related to
the manifest files. My wxPython apps run within python must have an XP
manifest tacked in somewhere, because I get XP theming and styles,
when compiled with py2exe they do not (I'm sure theres a way to
include the manifest as a resource using py2exe, I just haven't spent
any time trying to do it).

路路路

On Fri, 20 Aug 2004 16:33:18 +0200, Fred P <fredp@dial.oleane.com> wrote:

(it is actually a hassle because I was foolishly _relying_ on that
behaviour to use several separators as spacers - obviously I'm going to
have to find something better :slight_smile:

(*) this is off-topic but just in case someone knows : my setup.py works
except for including an icon in the executable. I've tried two methods
found on the wxpython and py2exe wikis (icon_resources in setup.py and
--icon on the command line) but both generate errors. Is this another XP
problem ?

Thanks,
fp

Chris Mellon wrote:

I haven't seen specifically this before, but I suspect it's related to
the manifest files. My wxPython apps run within python must have an XP
manifest tacked in somewhere, because I get XP theming and styles,
when compiled with py2exe they do not (I'm sure theres a way to
include the manifest as a resource using py2exe, I just haven't spent
any time trying to do it).

Thanks for the tip - I remember seeing something about manifest files on the py2exe wiki, I'll try to find it back...

Another cause for the different behaviours between python and py2exe execution is also in the wiki FAQ : python runs site.py, py2exe does not. That's where the strange 'encodings' errors come from.

Fred P wrote:

Thanks for the tip - I remember seeing something about manifest files on the py2exe wiki, I'll try to find it back...

That really was the clincher. I'd tried googling around the problem without too much success earlier, but as usual once you've go the right keyword ten thousand answers will bloom...

Tuns out this is a recurring FAQ both here and on the py2exe list. Sorry everyone !

fp

Fred P wrote:

Chris Mellon wrote:

I haven't seen specifically this before, but I suspect it's related to
the manifest files. My wxPython apps run within python must have an XP
manifest tacked in somewhere, because I get XP theming and styles,
when compiled with py2exe they do not (I'm sure theres a way to
include the manifest as a resource using py2exe, I just haven't spent
any time trying to do it).

Thanks for the tip - I remember seeing something about manifest files on the py2exe wiki, I'll try to find it back...

On XP when the manifest file is present then the 6.0 version of the common controls DLL is used, which uses the theming engine to draw the controls. Otherwise the 5.x version is used, which is the same as what is used on win2k.

To supply a manifest file with your py2exe'd app just copy the python.exe.manifest that wxPython installed next to your python.exe, change the name, and put it next your your app's .exe file.

路路路

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!