From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/python~3.12/library%2Ftkinter.dnd.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 devdocs/python~3.12/library%2Ftkinter.dnd.html (limited to 'devdocs/python~3.12/library%2Ftkinter.dnd.html') diff --git a/devdocs/python~3.12/library%2Ftkinter.dnd.html b/devdocs/python~3.12/library%2Ftkinter.dnd.html new file mode 100644 index 00000000..db26161a --- /dev/null +++ b/devdocs/python~3.12/library%2Ftkinter.dnd.html @@ -0,0 +1,26 @@ +

tkinter.dnd — Drag and drop support

Source code: Lib/tkinter/dnd.py

Note

This is experimental and due to be deprecated when it is replaced with the Tk DND.

The tkinter.dnd module provides drag-and-drop support for objects within a single application, within the same window or between windows. To enable an object to be dragged, you must create an event binding for it that starts the drag-and-drop process. Typically, you bind a ButtonPress event to a callback function that you write (see Bindings and Events). The function should call dnd_start(), where ‘source’ is the object to be dragged, and ‘event’ is the event that invoked the call (the argument to your callback function).

Selection of a target object occurs as follows:

  1. Top-down search of area under mouse for target widget
  1. Call to <old_target>.dnd_leave(source, event) +
  2. Call to <new_target>.dnd_enter(source, event) +
  3. Call to <target>.dnd_commit(source, event) to notify of drop
  4. Call to <source>.dnd_end(target, event) to signal end of drag-and-drop
+class tkinter.dnd.DndHandler(source, event)
+

The DndHandler class handles drag-and-drop events tracking Motion and ButtonRelease events on the root of the event widget.

+cancel(event=None)
+

Cancel the drag-and-drop process.

+
+finish(event, commit=0)
+

Execute end of drag-and-drop functions.

+
+on_motion(event)
+

Inspect area below mouse for target objects while drag is performed.

+
+on_release(event)
+

Signal end of drag when the release pattern is triggered.

+
+
+tkinter.dnd.dnd_start(source, event)
+

Factory function for drag-and-drop process.

+

See also

Bindings and Events

+

+ © 2001–2023 Python Software Foundation
Licensed under the PSF License.
+ https://docs.python.org/3.12/library/tkinter.dnd.html +

+
-- cgit v1.2.3