Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with dearpygui #74

Open
ki11roy opened this issue Dec 26, 2022 · 0 comments
Open

Problem with dearpygui #74

ki11roy opened this issue Dec 26, 2022 · 0 comments

Comments

@ki11roy
Copy link

ki11roy commented Dec 26, 2022

It seems that call to ctypes.windll.shcore.SetProcessDpiAwareness(2) breaks scaling in dearpygui https://github.com/hoffstadt/DearPyGui, see this example (dearpygui 1.8.0) and calling ctypes.windll.shcore.SetProcessDpiAwareness(0) won't help:

import ctypes
import dearpygui.dearpygui as dpg
from screeninfo import screeninfo

dpg.create_context()
dpg.create_viewport(title='Custom Title', width=600, height=300, decorated=False)

with dpg.window(label="Example Window"):
    dpg.add_text("Hello, world")
    dpg.add_button(label="Save")
    dpg.add_input_text(label="string", default_value="Quick brown fox")
    dpg.add_slider_float(label="float", default_value=0.273, max_value=1)

# calling either of
#     screeninfo.get_monitors()
# or
#     ctypes.windll.shcore.SetProcessDpiAwareness(2)
# inevitably changes viewport scale

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant