I want to drag and drop items onto the gui. I believe thats possible with tkinter? But whenever I try to run this, I get this error. Also stackoverflow is so annoying. I need to add more text for what? This is literally everything you need to know. Theres not even a submit button after it says to review and I got to refresh the page and retype everything. :
File "/Users/yasingunaydin/Documents/GitHub/RegExorcist/regexorcist.py", line 92, in <module>
window = TkinterDnD.Tk()
^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/tkinterdnd2/TkinterDnD.py", line 285, in __init__
self.TkdndVersion = _require(self)
^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/tkinterdnd2/TkinterDnD.py", line 55, in _require
raise RuntimeError('Unable to load tkdnd library.')
RuntimeError: Unable to load tkdnd library.
This is what I added to my code:
from tkinterdnd2 import TkinterDnD, DND_FILES
# GUI
window = TkinterDnD.Tk()
window.title('RegExorcist')
# Bind drag-and-drop events
window.drop_target_register(DND_FILES)
window.dnd_bind('<<Drop>>', on_drop)
window.dnd_bind('<<DragEnter>>', on_drag_enter)
I have installed tkinter, tkinterdnd, tkinterdnd2
Expected the result of a working code..
1