Re: Support for High DPI on Windows 10

Eric Fahlgren <[email protected]> Tue, 17 Jul 2018 01:58:51 -0700
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <CAP2Qz+XS+17HxP2XhRj2X-6HgW6CmNhsAnLgaW6UQie1xEHiVQ@mail.gmail.com>
I've dealt with this in two areas, 1) turn on high DPI awareness at
application startup; 2) hack up various pure Python bits of wxPython to
allow me to control font size (I use the agw ribbon bar, which has
hard-coded font sizes internally, so I've got various patches that add font
resizing capabilities).

class App(wx.App):
    def __init__(self, redirect=False, **kwds):
        try:
            from ctypes import OleDLL
            # Turn on high-DPI awareness to make sure rendering is sharp on
big
            # monitors with font scaling enabled.
            OleDLL('shcore').SetProcessDpiAwareness(1)
        except AttributeError:
            # We're on a non-Windows box.
            pass
        except OSError:
            # exc.winerror is often E_ACCESSDENIED (-2147024891/0x80070005).
            # This occurs after the first run, when the parameter is reset
in the
            # executable's manifest and then subsequent calls raise this
exception
            # See last paragraph of Remarks at
            #
https://msdn.microsoft.com/en-us/library/dn302122(v=vs.85).aspx
            pass


On Mon, Jul 16, 2018 at 9:09 PM Ryan Holmes <[email protected]> wrote:

> Hey there,
>
> So, I've had some users complain about scaling issues on Windows. I
> understand that support for scaling on Windows is kinda iffy - a lot of the
> support comes from wxWidgerts 3.1, which there currently isn't a wxPython
> build for (that I know of). So, my questions are:
>
> 1) When can we expect a wxPython 4.1.0 build to test out so that we can
> play around with the new wxWidget features?
> 2) Is there anything that I can do in the interim while using 4.0.x?
> Anything to sharpen the text in Windows?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.