Skip to content

Cannot configure windows height/width when init file is enabled. Expected behavior? #1570

Answered by hoffstadt
ultgift asked this question in Support
Discussion options

You must be logged in to vote

This is correct behavior. The init file overrides the initial window height/width. You can set them after. i.e.

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.configure_app(init_file="dpg.ini")
dpg.create_viewport()
dpg.setup_dearpygui()

def callback():
    # configuring height/width: No longer works when init_file is set.
    dpg.set_item_height("win", 200)
    dpg.set_item_width("win", 800)


with dpg.window(tag="win"):
    dpg.add_button(label="Press me", callback=callback)



dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ultgift
Comment options

@ultgift
Comment options

Answer selected by ultgift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants