DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

item_toggled_open_handler does not provide "app_data" to callback

Open Yamahari opened this issue 1 year ago • 0 comments

Version of Dear PyGui

Version: 1.11.1 Operating System: Window 10

My Issue/Question

item_toggled_open_handler does not provide "app_data" to callback

To Reproduce

  1. Open/Close the tree node

Expected behavior

"app_data" should contain the tag of the node that was clicked?

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

def main():
    dpg.create_context()

    def toggle(sender, app_data, user_data):
        print(sender, app_data, user_data)

    with dpg.item_handler_registry(tag="widget_handler") as handler:
        dpg.add_item_toggled_open_handler(tag='toggle_handler', callback=toggle, user_data=1)

    with dpg.window(width=500, height=300):
        with dpg.tree_node() as tree_node:
            dpg.bind_item_handler_registry(tree_node, "widget_handler")

    dpg.create_viewport(title='Custom Title', width=800, height=600)
    dpg.setup_dearpygui()
    dpg.show_viewport()
    dpg.start_dearpygui()
    dpg.destroy_context()

if __name__ == '__main__':
    main()

Yamahari avatar Jun 18 '24 14:06 Yamahari