Py2exe make wxPython window looks bad

Discussion in 'Python' started by zdp, Jun 30, 2006.

  1. zdp

    zdp Guest

    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"]
    )
     
    zdp, Jun 30, 2006
    #1
    1. Advertising

  2. zdp

    Guest

    , Jun 30, 2006
    #2
    1. Advertising

  3. zdp

    Ben Sizer Guest

    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
     
    Ben Sizer, Jun 30, 2006
    #3
  4. 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
     
    Andreas Kaiser, Jun 30, 2006
    #4
  5. zdp

    Guest

    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, 2006
    #5
  6. zdp

    zdp Guest

    Great, thanks all

    写é“:

    > 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/FAQ#head-4cc058aed6216dd200d55a6e4c077ccbe82bd142
    >
    > Regards,
    >
    > Ray Smith
    > http://RaymondSmith.com
     
    zdp, Jun 30, 2006
    #6
  7. Ray wrote:
    > http://wiki.wxpython.org/index.cgi/FAQ#head-4cc058aed6216dd200d55a6e4c077ccbe82bd142



    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.
     
    Jonathan Harris, Jul 4, 2006
    #7
  8. 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
    --
    The problem with the world is stupidity. Not saying there should be a
    capital punishment for stupidity, but why don't we just take the
    safety labels off of everything and let the problem solve itself?
    Frank Zappa
     
    Sybren Stuvel, Jul 4, 2006
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Namdoog
    Replies:
    0
    Views:
    577
    Namdoog
    Sep 15, 2003
  2. Jerry
    Replies:
    3
    Views:
    472
    Jerry
    Aug 29, 2006
  3. John  Fullman
    Replies:
    12
    Views:
    492
    Protoman
    Sep 22, 2005
  4. Leo Lee
    Replies:
    3
    Views:
    402
    Leo Lee
    Jul 17, 2008
  5. rantingrick
    Replies:
    44
    Views:
    1,247
    Peter Pearson
    Jul 13, 2010
Loading...

Share This Page