Skip to content

Commit

Permalink
Add high dpi support in wxpython example (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomczak committed Feb 11, 2017
1 parent a6c0a0a commit be10dba
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions examples/wxpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# To install wxPython on Linux type "sudo apt-get install python-wxtools".

# Tested with wxPython 2.8 on Linux, wxPython 3.0 on Windows/Mac
# and CEF Python v55.3.
# and CEF Python v55.3+.

import wx
from cefpython3 import cefpython as cef
Expand All @@ -22,7 +22,15 @@
def main():
check_versions()
sys.excepthook = cef.ExceptHook # To shutdown all CEF processes on error
cef.Initialize()
settings = {}
if WINDOWS:
# High DPI support
settings["auto_zooming"] = "system_dpi"
# Embed DPI awareness xml manifest inside .exe (recommended,
# most reliable) or call the SetProcessDpiAware function.
# noinspection PyUnresolvedReferences
cef.DpiAware.SetProcessDpiAware()
cef.Initialize(settings=settings)
app = CefApp(False)
app.MainLoop()
del app # Must destroy before calling Shutdown
Expand Down

0 comments on commit be10dba

Please sign in to comment.