DearPyGui-DragAndDrop
Working Drag-and-drop for DearPyGui, Windows only
How to install/use
-
Install the DearPyGui-DragAndDrop package:
pip install DearPyGui-DragAndDrop
-
Import and then initialize the library after dpg.create_context()
:
import dearpygui.dearpygui as dpg
import DearPyGui_DragAndDrop as dpg_dnd
dpg.create_context()
dpg_dnd.initialize()
- That's it, just set your function for
drop
and your minimal use case is ready:
import dearpygui.dearpygui as dpg
import DearPyGui_DragAndDrop as dpg_dnd
dpg.create_context()
dpg_dnd.initialize()
dpg.create_viewport(title="Drag and drop example", width=600, height=600)
def drop(data, keys):
print(f'{data}')
print(f'{keys}')
dpg_dnd.set_drop(drop)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
More examples of use are in the Examples folder
Supported Formats
Everything else will be None
or will be a string
TODO list: