I have tried dragging and dropping from a canvas to another canvas, but now I need to drag from a frame and drop it on canvas, Is it possible in tkinter ? I am really naive in tkinter .. :)
It's possible. Bind to <ButtonPress-1>
on the Treeview
to start, use the event information to get what was clicked on, and the do a binding on <ButtonRelease-1>
to handle the drop.
You'll have to manage any sort of visual indication yourself. One solution is to use a Toplevel
window, set the overrideredirect
attribute, put something in the window (eg: the text being dragged), and then bind to <B1-Motion>
to move the window as the user moves the mouse.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句