Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • new style scrollbars on XP?

    7 answers - 1140 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello,
    I am using the wxScrollBar in an application and would like it to
    display using the "new" XP themes on windows. However, it uses the
    "old" standard gray scroll bars instead. Is there a flag to set to tell
    it to use the new style theme?
    The little program below shows that the styled text control scrollbars
    are rendered with themes, but the stand alone scroll bar isn't. I've
    also attached a screen shot.
    thanks,
    eric
    # sample program
    import wx
    from wx import stc
    class MyFrame(wx.Frame):
    def __init__(self):
    wx.Frameinit__(self, None, -1, "My Frame", size=(350, 150))
    panel = wx.Panel(self, -1)
    stc.StyledTextCtrl( panel, -1, pos = (5,5), size=(300,50) )
    wx.ScrollBar(panel, pos=(40,80), size=(100, 20),
    style=wx.HRIZNTAL)
    if __name__ == "__main__":
    app = wx.PySimpleApp()
    frame = MyFrame()
    frame.Show(True)
    app.MainLoop()
    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.1 | | 565 bytes | |

    eric jones wrote:
    Hello,

    I am using the wxScrollBar in an application and would like it to
    display using the "new" XP themes on windows. However, it uses the
    "old" standard gray scroll bars instead. Is there a flag to set to tell
    it to use the new style theme?

    The little program below shows that the styled text control scrollbars
    are rendered with themes, but the stand alone scroll bar isn't. I've
    also attached a screen shot.

    I'm not sure what's going on, I get the themed scrollbar in both cases here.
  • No.2 | | 1137 bytes | |

    Robin Dunn wrote:
    eric jones wrote:
    >Hello,
    >>

    >I am using the wxScrollBar in an application and would like it to
    >display using the "new" XP themes on windows. However, it uses the
    >"old" standard gray scroll bars instead. Is there a flag to set to
    >tell it to use the new style theme?
    >>

    >The little program below shows that the styled text control
    >scrollbars are rendered with themes, but the stand alone scroll bar
    >isn't. I've also attached a screen shot.
    >

    I'm not sure what's going on, I get the themed scrollbar in both cases
    here.

    Hmmm. The concensus here is that it has something to do with our build
    of wx (). Does anyone know of flags
    etc in the setup.h or in the build process that could cause this sort of
    behavior?

    thanks,
    eric

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.3 | | 1462 bytes | |

    eric wrote:
    Robin Dunn wrote:
    >eric jones wrote:

    Hello,

    I am using the wxScrollBar in an application and would like it to
    display using the "new" XP themes on windows. However, it uses the
    "old" standard gray scroll bars instead. Is there a flag to set to
    tell it to use the new style theme?

    The little program below shows that the styled text control
    scrollbars are rendered with themes, but the stand alone scroll bar
    isn't. I've also attached a screen shot.
    >>

    >I'm not sure what's going on, I get the themed scrollbar in both cases
    >here.
    >>

    Hmmm. The concensus here is that it has something to do with our build
    of wx (). Does anyone know of flags
    etc in the setup.h or in the build process that could cause this sort of
    behavior?

    After a little more thought I seem to recall that the scrollbar attached
    to windows is a different control than the standalone control, so my
    guess is that you don't have a manifest file for your python. It's the
    presence of this manifest (either as a resource in the .exe or as a file
    located next to the .exe named programname.exe.manifest) that triggers
    the use of the themed common controls DLL. If it's not present then XP
    falls back to the 5.x version of the DLL.
  • No.4 | | 1877 bytes | |

    Robin Dunn wrote:

    eric wrote:
    >
    >Robin Dunn wrote:
    >>

    eric jones wrote:

    Hello,

    I am using the wxScrollBar in an application and would like it to
    display using the "new" XP themes on windows. However, it uses the
    "old" standard gray scroll bars instead. Is there a flag to set to
    tell it to use the new style theme?

    The little program below shows that the styled text control
    scrollbars are rendered with themes, but the stand alone scroll bar
    isn't. I've also attached a screen shot.

    I'm not sure what's going on, I get the themed scrollbar in both
    cases here.

    >Hmmm. The concensus here is that it has something to do with our
    >build of wx (). Does anyone know of
    >flags etc in the setup.h or in the build process that could cause
    >this sort of behavior?
    >
    >

    After a little more thought I seem to recall that the scrollbar
    attached to windows is a different control than the standalone
    control, so my guess is that you don't have a manifest file for your
    python. It's the presence of this manifest (either as a resource in
    the .exe or as a file located next to the .exe named
    programname.exe.manifest) that triggers the use of the themed common
    controls DLL. If it's not present then XP falls back to the 5.x
    version of the DLL.

    Sayyy! That gives us a whole lot of direction on getting this
    resolved. We'll dig in and see if this is indeed the issue.

    Thanks for your help Robin.

    regards,
    eric

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.5 | | 3019 bytes | |

    May 19, 2006, at 11:25 PM, eric jones wrote:

    Robin Dunn wrote:
    >
    >eric wrote:
    >>

    Robin Dunn wrote:

    eric jones wrote:

    Hello,

    I am using the wxScrollBar in an application and would like it
    to display using the "new" XP themes on windows. However, it
    uses the "old" standard gray scroll bars instead. Is there a
    flag to set to tell it to use the new style theme?

    The little program below shows that the styled text control
    scrollbars are rendered with themes, but the stand alone scroll
    bar isn't. I've also attached a screen shot.

    I'm not sure what's going on, I get the themed scrollbar in both
    cases here.

    Hmmm. The concensus here is that it has something to do with our
    build of wx (). Does anyone
    know of flags etc in the setup.h or in the build process that
    could cause this sort of behavior?
    >>
    >>

    >After a little more thought I seem to recall that the scrollbar
    >attached to windows is a different control than the standalone
    >control, so my guess is that you don't have a manifest file for
    >your python. It's the presence of this manifest (either as a
    >resource in the .exe or as a file located next to the .exe named
    >programname.exe.manifest) that triggers the use of the themed
    >common controls DLL. If it's not present then XP falls back to
    >the 5.x version of the DLL.
    >>

    Sayyy! That gives us a whole lot of direction on getting this
    resolved. We'll dig in and see if this is indeed the issue.
    Thanks for your help Robin.

    Here's an example of a manifest file that I use on windows xp:

    MANIFEST_TEMPLATE = '''
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns=""
    manifestVersion="1.0">
    <assemblyIdentity
    version="5.0.0.0"
    processorArchitecture="x86"
    name="%(prog)s"
    type="win32"
    />
    <description>%(file_description)s</description>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity
    type="win32"
    name=""
    version="6.0.0.0"
    processorArchitecture="X86"
    publicKeyToken="6595b64144ccf1df"
    language="*"
    />
    </dependentAssembly>
    </dependency>
    </assembly>
    '''

    And then I use it when I build an executable using cx_Freeze:

    data = MANIFEST_TEMPLATE % dict(prog=constants.PRGRAM_NAME,
    )
    manifest = file(executableDistPath + ".manifest", 'w')
    manifest.write(data)
    manifest.close()

    John Jackson

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.6 | | 3169 bytes | |

    Many thanks for this.

    eric

    John Jackson wrote:

    May 19, 2006, at 11:25 PM, eric jones wrote:
    >
    >Robin Dunn wrote:
    >>

    eric wrote:

    Robin Dunn wrote:

    eric jones wrote:

    Hello,

    I am using the wxScrollBar in an application and would like it
    to display using the "new" XP themes on windows. However, it
    uses the "old" standard gray scroll bars instead. Is there a
    flag to set to tell it to use the new style theme?

    The little program below shows that the styled text control
    scrollbars are rendered with themes, but the stand alone scroll
    bar isn't. I've also attached a screen shot.

    I'm not sure what's going on, I get the themed scrollbar in both
    cases here.

    Hmmm. The concensus here is that it has something to do with our
    build of wx (). Does anyone know
    of flags etc in the setup.h or in the build process that could
    cause this sort of behavior?

    After a little more thought I seem to recall that the scrollbar
    attached to windows is a different control than the standalone
    control, so my guess is that you don't have a manifest file for
    your python. It's the presence of this manifest (either as a
    resource in the .exe or as a file located next to the .exe named
    programname.exe.manifest) that triggers the use of the themed
    common controls DLL. If it's not present then XP falls back to the
    5.x version of the DLL.

    >Sayyy! That gives us a whole lot of direction on getting this
    >resolved. We'll dig in and see if this is indeed the issue.
    >Thanks for your help Robin.
    >
    >

    Here's an example of a manifest file that I use on windows xp:

    MANIFEST_TEMPLATE = '''
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns=""
    manifestVersion="1.0">
    <assemblyIdentity
    version="5.0.0.0"
    processorArchitecture="x86"
    name="%(prog)s"
    type="win32"
    />
    <description>%(file_description)s</description>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity
    type="win32"
    name=""
    version="6.0.0.0"
    processorArchitecture="X86"
    publicKeyToken="6595b64144ccf1df"
    language="*"
    />
    </dependentAssembly>
    </dependency>
    </assembly>
    '''

    And then I use it when I build an executable using cx_Freeze:

    data = MANIFEST_TEMPLATE % dict(prog=constants.PRGRAM_NAME,
    )
    manifest = file(executableDistPath + ".manifest", 'w')
    manifest.write(data)
    manifest.close()

    John Jackson
    --

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.7 | | 1901 bytes | |

    John Jackson wrote:
    Here's an example of a manifest file that I use on windows xp:

    MANIFEST_TEMPLATE = '''
    [snip]
    '''

    And then I use it when I build an executable using cx_Freeze:

    data = MANIFEST_TEMPLATE % dict(prog=constants.PRGRAM_NAME,
    )
    manifest = file(executableDistPath + ".manifest", 'w')
    manifest.write(data)
    manifest.close()

    It turns out that you can also embed the manifest into the resources of
    a Windows executable. Since I needed to use a custom base executable
    anyway, I did it this way.

    I'm using MinGW and MSYS.

    First, I made a dead simple .rc file:

    1 24 "myapp.exe.manifest"
    101 ICN myapp.ico

    The second line adds an application icon, which I also needed.

    I compiled it with windres, the resource compiler that comes with MinGW:

    windres Win32Resources.rc Win32Resources.o

    Note, though, that windres isn't completely compatible with the
    Microsoft resource compiler. This only worked because it was stupidly
    simple.

    After that, I compiled my modified base executable, Win32GUI_quiet.exe:

    gcc -Wall -I. -I/c/Python24/include \
    -s /c/WINDWS/system32/python24.dll -mwindows \
    -o Win32GUI_quiet.exe Win32GUI_quiet.c Win32Resources.o

    Finally, I ran cx_Freeze with (among other things) the option
    " `pwd`/Win32GUI_quiet.exe".

    Ta-da! less file to distribute.

    (As an aside, cx_Freeze is the greatest thing ever! I mention this here
    because the last time I mentioned it, I wasn't particularly positive.
    Since then, I've evaluated it better and I'm really impressed with it.)

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org

Re: new style scrollbars on XP?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 1 =
QUESTION ON "Python"

EMSDN.COM