views:

594

answers:

4

Hi, guys.

I noticed that my programs written with wxPython have Win98 button style. But Boa Constructor (that is written using wxPython too) got pretty buttons.

How to make buttons look like current Windows buttons style?

A: 

Have you tried running your scripts with pythonw.exe instead of python.exe?

kgiannakakis
I will try, but I think - no matter, 'cause the same app written using PyQt works perfectly, I think that's problem of wxPython.
Kirill Titov
+3  A: 

Are you packaging the app with py2exe?

If so you may need to specify a manifest file to make Python use the WinXP(Vista?) theme/Common Controls:

http://wiki.wxpython.org/DistributingYourApplication

John Montgomery
OK, but how about Windows Vista or Windows 7 styles? Does this manifest support that styles?
Kirill Titov
Sorry Mac user, by WinXP i just mean "modern windows". I think it'll work for Vista too, but I only have an XP laptop for testing at home so YMMV.
John Montgomery
+1  A: 

Expanding on John's answer, you may also be able to create manifest files for python.exe and pythonw.exe to see the new styles without first packaging using py2exe.

Ben Blank
A: 

The answers so far handle distributing the package as an executable (eg. py2exe), where the answer has already been given.

But since (i think) python 2.6 you have the same problem when just starting the .py file from the commandline (Vista and Windows7). Robin Dunn suggested using update_manifest.py which he distributes with wxPython and puts it in the same directory as python.exe.

After applying update_manifest.py using a copied version of python.exe wxPython apps have the correct themed look and yes it also works using windows7 RC1.

RSabet