initial commit. Drop Files work
commit
49e976e4b7
|
|
@ -0,0 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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()
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue