This single file implementation can set up a callback fired when files and/or folders are dropped onto a uifigure component.
In the callback, the full file and/or folder names are captured for user to decide the action. Ctrl and Shift key status during the drop event are also reported.
Example to drop file/folder into uilistbox:
DnD_uifigure(uilistbox(uifigure), @(o,dat)set(o,'Items',dat.names))
Xiangrui Li (2021). uiFileDnD (https://github.com/xiangruili/uiFileDnD), GitHub. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.