You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a window with popup=True and show=False gets displayed for the first time, it is positioned in the top left corner of the viewport, whereas on subsequent show_item() calls it appears at the mouse cursor position. I'm talking about dpg.window() here, not about dpg.popup().
To Reproduce
Steps to reproduce the behavior:
Run the example below
Click on 'Click me!'
Notice that the popup is displayed in the top left corner of the viewport.
Dismiss the popup by clicking somewhere else.
Click on 'Click me!' again.
Notice that from now on, the popup shows up at the mouse cursor.
Expected behavior
I'd expect that the first call to dpg.show_item() for a popup=True window to position the window at the mouse cursor, just like subsequent calls do.
BTW that's the way dpg.popup() works, and it uses dpg.window(popup=True, show=False) internally, so it would only be reasonable to have the same behavior in both cases.
Screenshots/Video
Standalone, minimal, complete and verifiable example
dpg.create_context()
dpg.create_viewport(title="Test", width=500, height=400)
with dpg.window(pos=(100, 100), width=300, height=100):
with dpg.window(popup=True, show=False, min_size=(1, 1)) as popup:
dpg.add_selectable(label="This is a popup")
dpg.add_button(label="Click me!", callback=lambda: dpg.show_item(popup))
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
The text was updated successfully, but these errors were encountered:
Version of Dear PyGui
Version: 1.8.0
Operating System: Windows 10
My Issue/Question
When a window with
popup=True
andshow=False
gets displayed for the first time, it is positioned in the top left corner of the viewport, whereas on subsequentshow_item()
calls it appears at the mouse cursor position. I'm talking aboutdpg.window()
here, not aboutdpg.popup()
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd expect that the first call to
dpg.show_item()
for apopup=True
window to position the window at the mouse cursor, just like subsequent calls do.BTW that's the way
dpg.popup()
works, and it usesdpg.window(popup=True, show=False)
internally, so it would only be reasonable to have the same behavior in both cases.Screenshots/Video
Standalone, minimal, complete and verifiable example
The text was updated successfully, but these errors were encountered: