Replies: 1 comment 1 reply
-
Here is an example using window as dialog popup: import dearpygui.dearpygui as dpg
dpg.create_context()
def right_click_cb(sender, app_data):
dpg.configure_item("right_click_menu", show=True)
with dpg.handler_registry():
dpg.add_mouse_click_handler(button=dpg.mvMouseButton_Right, callback=right_click_cb)
with dpg.window(label="Right click window", modal=True, show=False, id="right_click_menu", no_title_bar=True):
dpg.add_text("All those beautiful files will be deleted.\nThis operation cannot be undone!")
dpg.add_separator()
dpg.add_checkbox(label="Don't ask me next time")
with dpg.group(horizontal=True):
dpg.add_button(label="OK", width=75, callback=lambda: dpg.configure_item("right_click_menu", show=False))
dpg.add_button(label="Cancel", width=75, callback=lambda: dpg.configure_item("right_click_menu", show=False))
with dpg.window(tag="Primary Window"):
dpg.add_text("Right click anywhere")
dpg.create_viewport(title='Test', width=300, height=50)
dpg.set_primary_window("Primary Window", True)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context() Consider also setting |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I'm trying to open a popup to emulate a context menu by clicking in the background of a window.
It's easy to associate a popup to a widget like a text or a button but if I try to do it with a window I have an error.
In this example I do it with a Node editor
It returns
SystemError: built-in function pop_container_stack returned a result with an error set
I'm stuck on it for a while... Am'I doing something wrong ?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions