hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en/latest/
MIT License
12.89k stars 671 forks source link

Changing window label causing docked window undock #1625

Open NickelLiang opened 2 years ago

NickelLiang commented 2 years ago

Version of Dear PyGui

Version: 1.3.1 Operating System: macOS 12.2

My Issue/Question

Changing a docked window label after creation will cause such window to undock itself.

To Reproduce

Create a window, dock it, then change its label. See minimal example.

Expected behavior

Changing the window title should not undock such a window.

Screenshots/Video

Nickel_2022-02-24_11-14-40

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.configure_app(docking=True, docking_space=True)

with dpg.window(label="Default Label", width=400, height=400, tag="__window", autosize=True):
    dpg.add_text("1. Dock me!")
    dpg.add_text("2. Click button below. Window label will change.")
    dpg.add_button(label="Change window label", callback=lambda: dpg.set_item_label("__window", "New Label"))
    dpg.add_text("3. Observe that the window now is undocked.")

dpg.create_viewport(title='DPG', width=800, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
hoffstadt commented 2 years ago

Nice catch! We will fix this ASAP.

ChabaneAmaury commented 1 year ago

High ! Any updates on this bug ? I just came across this one by accident on version 1.9.0 and it is a bit interferring with my project...