Open justin-m-lacy opened 4 weeks ago
This pull request implements drag-and-drop functionality for source and target files in the user interface. It uses the tkinterdnd2 library to enable this feature. The changes primarily affect the ui.py
file, modifying the root window creation and adding event handlers for drag-and-drop operations.
Files | Changes |
---|---|
modules/ui.py |
Created a new class CTk that inherits from both ctk.CTk and TkinterDnD.DnDWrapper to enable drag-and-drop functionality |
modules/ui.py |
Modified the create_root function to use the new CTk class instead of ctk.CTk |
modules/ui.py |
Added drag-and-drop event bindings to source and target labels and buttons |
modules/ui.py |
Implemented drop_source_file and drop_target_file functions to handle dropped files |
modules/ui.py |
Refactored select_source_path and select_target_path functions to use new set_source_path and set_target_path functions |
modules/ui.py |
Implemented set_source_path and set_target_path functions to handle both manual selection and drag-and-drop |
Commit adds library tkinterdnd2 to enable dragging and dropping of source and target files from the file explorer.
Note that on Visual Studio Code, drag and drop may be blocked if VSCode was installed per-user, instead of for all users.
I am not a python programmer, but have tested this myself on Windows 10, and it works.
It may be you don't want to use the additional tkinter library in which case you can ignore.
Summary by Sourcery
Integrate drag-and-drop functionality for source and target files in the UI by using the tkinterdnd2 library. Refactor the UI initialization to support this feature, allowing users to drag files directly from the file explorer into the application.
New Features:
Enhancements: