Files
@ fc72f550ddcd
Branch filter:
Location: light9/bin/tkdnd_minimal_drop.py - annotation
fc72f550ddcd
1.3 KiB
text/x-python
annual update of the hardcoded URIs in frontend code that I don't bother to fix
Ignore-this: 3c438cd972d3014cca2383f943023b1b
Ignore-this: 3c438cd972d3014cca2383f943023b1b
339e99981fd4 339e99981fd4 f066d6e874db 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 7772cc48e016 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 f066d6e874db 7772cc48e016 7772cc48e016 339e99981fd4 f066d6e874db 7772cc48e016 7772cc48e016 339e99981fd4 f066d6e874db 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 339e99981fd4 339e99981fd4 7772cc48e016 7772cc48e016 7772cc48e016 7772cc48e016 339e99981fd4 339e99981fd4 7772cc48e016 339e99981fd4 f066d6e874db 7772cc48e016 7772cc48e016 339e99981fd4 339e99981fd4 339e99981fd4 339e99981fd4 7772cc48e016 339e99981fd4 | #!bin/python
from run_local import log
import tkinter as tk
from light9.tkdnd import initTkdnd, dropTargetRegister
from twisted.internet import reactor, tksupport
root = tk.Tk()
initTkdnd(root.tk, "tkdnd/trunk/")
label = tk.Label(root, borderwidth=2, relief='groove', padx=10, pady=10)
label.pack()
label.config(text="drop target %s" % label._w)
frame1 = tk.Frame()
frame1.pack()
labelInner = tk.Label(frame1, borderwidth=2, relief='groove', padx=10, pady=10)
labelInner.pack(side='left')
labelInner.config(text="drop target inner %s" % labelInner._w)
tk.Label(frame1, text="not a target").pack(side='left')
def onDrop(ev):
print("onDrop", ev)
def enter(ev):
print('enter', ev)
def leave(ev):
print('leave', ev)
dropTargetRegister(label,
onDrop=onDrop,
onDropEnter=enter,
onDropLeave=leave,
hoverStyle=dict(background="yellow", relief='groove'))
dropTargetRegister(labelInner,
onDrop=onDrop,
onDropEnter=enter,
onDropLeave=leave,
hoverStyle=dict(background="yellow", relief='groove'))
def prn():
print("cont", root.winfo_containing(201, 151))
b = tk.Button(root, text="coord", command=prn)
b.pack()
#tk.mainloop()
tksupport.install(root, ms=10)
reactor.run()
|