By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,725 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,725 IT Pros & Developers. It's quick & easy.

Py2exe make wxPython window looks bad

P: n/a
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"]
)

Jun 30 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a

zdp wrote:
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/F...077ccbe82bd142

Regards,

Ray Smith
http://RaymondSmith.com

Jun 30 '06 #2

P: n/a
zdp wrote:
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.

--
Ben Sizer

Jun 30 '06 #3

P: n/a

zdp schrieb:
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

Jun 30 '06 #4

P: n/a
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

zdp wrote:
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"]
)


Jun 30 '06 #5

P: n/a
zdp
Great, thanks all

ra****@gmail.com 写道:
zdp wrote:
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/F...077ccbe82bd142

Regards,

Ray Smith
http://RaymondSmith.com


Jun 30 '06 #6

P: n/a
Ray wrote:
http://wiki.wxpython.org/index.cgi/F...077ccbe82bd142

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.
Jul 4 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.