initial commit. Drop Files work

master
a.jurcenko 2023-09-05 16:36:34 +02:00
commit 49e976e4b7
8 changed files with 55 additions and 0 deletions

3
.idea/.gitignore vendored 100644
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml 100644
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (test_tkinter_drop_files)" project-jdk-type="Python SDK" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/test_tkinter_drop_files.iml" filepath="$PROJECT_DIR$/.idea/test_tkinter_drop_files.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml 100644
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

18
main.py 100644
View File

@ -0,0 +1,18 @@
import tkinter as tk
from tkinterdnd2 import DND_FILES, TkinterDnD
window = TkinterDnD.Tk()
main_frame = tk.Frame(window, padx=50, pady=20)
main_frame.pack(fill=tk.BOTH, expand=True)
listbox = tk.Listbox(main_frame)
listbox.drop_target_register(DND_FILES)
listbox.dnd_bind('<<Drop>>', lambda x: listbox.insert(tk.END, x.data))
listbox.pack(fill=tk.BOTH, expand=True)
button = tk.Button(main_frame, text='Button')
button.pack(fill=tk.BOTH, expand=True)
window.mainloop()

BIN
requirements.txt 100644

Binary file not shown.