Py2exe make wxPython window looks bad

Z

zdp

Dear all:

I made a window program by wxPython. Split windows, treectrl, listctrl
and textctrl are used. When I program in python, the look & feel of the
window controls are like the windos XP look & feel, with thin and flat
border (My os is window XP). It's natural because, as I know, wxPython
use native look and feel.

But when I convert the program to EXE file by Py2exe, and run it, the
look & feel is bad. It's just like the windows 9x. All controls has a
thick and emboss border. However, the scrollbars look good, same as the
window XP.

So I'm puzzled. What's the problem and how can I get a XP look & feel
window program? Should I add some code in my program to set the look
and feel, or, set some options in py2exe script to force the generated
exe has specified look and feel?

The setup.py is very simple as following:

-------------setup.py---------------------
import sys, os
from distutils.core import setup
import py2exe
import glob

setup( name = "mainframe",
windows = ["mainframe.py"]
)
 
R

ray223

B

Ben Sizer

zdp said:
But when I convert the program to EXE file by Py2exe, and run it, the
look & feel is bad. It's just like the windows 9x. All controls has a
thick and emboss border. However, the scrollbars look good, same as the
window XP.

Bear in mind that a lot of WinXP users stick with the old-style theme
anyway, so you may want to consider them too when designing your forms.
Sadly, WxWidget layouts tend to look bad on the old Windows theme,
largely because there are too many unnecessary borders on the various
elements, and I don't know if that's an inherent problem with the
toolkit or just an oversight on the part of those who only develop
under the newer themes.
 
A

Andreas Kaiser

zdp said:
But when I convert the program to EXE file by Py2exe, and run it, the
look & feel is bad. It's just like the windows 9x. All controls has a
thick and emboss border. However, the scrollbars look good, same as the
window XP.
XP needs a manifest file in the setup.py or as a single file in the
program dir. See examples in the py2exe installation dir.

Andreas
 
D

diffuser78

My question is not exactly related. In windows you create exe using
py2exe.

What is the Linux equivalent of it ? I am assuming you just make your
..py file executable by doint this. Please correct me if I am wrong.
***********************************
chmoad a+c file_name.py
***********************************


I recently wrote a small app using wxPython. It is meant to be run on
Windows and Linux both. In Windows I have created the exe as given in
py2exe.org.

What do I need to do in Linux if I need to distribute to people using
Linux who don't have all the dependent libraries installed in their
Linux distro ??

Every help is appreciated.

Thanks
 
Z

zdp

Great, thanks all

(e-mail address removed) 写é“:
zdp said:
Dear all:

I made a window program by wxPython. Split windows, treectrl, listctrl
and textctrl are used. When I program in python, the look & feel of the
window controls are like the windos XP look & feel, with thin and flat
border (My os is window XP). It's natural because, as I know, wxPython
use native look and feel.
[snip]

http://wiki.wxpython.org/index.cgi/FAQ#head-4cc058aed6216dd200d55a6e4c077ccbe82bd142

Regards,

Ray Smith
http://RaymondSmith.com
 
J

Jonathan Harris

Ray said:


Here's a trick that embeds the manifest into the executable (which is a
little cleaner) and adds meta info.


1. Add this to the top of your setup.py. Supply your application's name,
version number and description as appname, appversion and appdescrip:

manifest=('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n'+
'<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">\n'+
'<assemblyIdentity\n'+
' version="%4.2f.0.0"\n' % appversion +
' processorArchitecture="X86"\n'+
' name="%s"\n' % appname +
' type="win32"\n'+
'/>\n'+
'<description>%s.</description>\n' % appdescrip +
'<dependency>\n'+
' <dependentAssembly>\n'+
' <assemblyIdentity\n'+
' type="win32"\n'+
' name="Microsoft.Windows.Common-Controls"\n'+
' version="6.0.0.0"\n'+
' processorArchitecture="X86"\n'+
' publicKeyToken="6595b64144ccf1df"\n'+
' language="*"\n'+
' />\n'+
' </dependentAssembly>\n'+
'</dependency>\n'+
'</assembly>\n')


2. Within your setup routine, change your 'windows' entry to:

windows = [{'script': 'mainframe.py',
'other_resources': [(24,1,manifest)],
}],


Jonathan.
 
S

Sybren Stuvel

Jonathan Harris enlightened us with:
Here's a trick that embeds the manifest into the executable (which
is a little cleaner) and adds meta info.

If you go for clean, I'd use triple quotes and include the XML in a
single string, instead of concatenating them and adding \n.

Sybren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top