Drag and drop on tree node
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Run the standalone Python example on Windows 11 and reproduce the missing highlight and drop_callback behavior for uncle treenodes. Trace the treenode drag-and-drop handling from this example, then verify that a widget can be dropped into any selected treenode, including one containing its parent treenode.
Written by the indexing model from the issue text.
Description
Version of Dear PyGui
Version: 2.3.0
Operating System: Windows 11
My Issue/Question
I used treenode to build a file browser with drag-and-drop functionality for moving files. I found that I cannot drag and drop the widget into a treenode that contains its parent treenode; it seems that the drop_callback is not being triggered correctly. Notice how the yellow highlight does not appear on uncle treenodes.
To Reproduce
Steps to reproduce the behavior:
- see video
Expected behavior
The widget should be put in the selected treenode.
Screenshots/Video
https://github.com/user-attachments/assets/83011dc4-3558-4bee-82e1-39964e9cbebb
Standalone, minimal, complete and verifiable example
import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(width=600, height=500)
dpg.setup_dearpygui()
def drop_cb(s, a, u):
dpg.move_item(a, parent=s)
with dpg.window(tag="test", width=500, height=400):
with dpg.tree_node(label="tree_node A",
drop_callback=drop_cb, payload_type="TEST", ):
dpg.add_selectable(label="select a")
with dpg.drag_payload(parent=dpg.last_item(), drag_data=dpg.last_item(), payload_type="TEST"):
dpg.add_button("a")
with dpg.tree_node(label="tree_node B",
drop_callback=drop_cb, payload_type="TEST"):
dpg.add_selectable(label="select b")
with dpg.drag_payload(parent=dpg.last_item(), drag_data=dpg.last_item(), payload_type="TEST"):
dpg.add_button("b")
with dpg.tree_node(label="tree_node C",
drop_callback=drop_cb, payload_type="TEST"):
dpg.add_selectable(label="select c")
with dpg.drag_payload(parent=dpg.last_item(), drag_data=dpg.last_item(), payload_type="TEST"):
dpg.add_button("c")
dpg.show_viewport()
dpg.set_primary_window("test", True)
dpg.start_dearpygui()
dpg.destroy_context()
- Dominant language
- C++
- Stars
- 15.7k
- Forks
- 790
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hoffstadt/DearPyGui
-
Plot series data silently truncated to float32 when passed as numpy array (should be float64/double)Openstate: pending type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
state: pending type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
state: pending type: improvement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
state: pending type: bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
state: pending type: improvement
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in hoffstadt/DearPyGui
Similar issues
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
bot-triaged module: correctness (silent) module: fft triage review
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
patrickjquinn/Marathon-Shell#84 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day