tkinter.scrolledtext — 卷动文本 Widget
tkinter.scrolledtext
tkinter.dnd
源代码: Lib/tkinter/dnd.py
注意
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).
dnd_start()
Selection of a target object occurs as follows:
Top-down search of area under mouse for target widget
Target widget should have a callable dnd_accept 属性 若 dnd_accept is not present or returns None , search moves to parent widget If no target widget is found, then the target object is None
Target widget should have a callable dnd_accept 属性
若 dnd_accept is not present or returns None , search moves to parent widget
None
If no target widget is found, then the target object is None
Call to <old_target>.dnd_leave(source, event)
Call to <new_target>.dnd_enter(source, event)
Call to <target>.dnd_commit(source, event) to notify of drop
Call to <source>.dnd_end(target, event) to signal end of drag-and-drop
The DndHandler class handles drag-and-drop events tracking Motion and ButtonRelease events on the root of the event widget.
Cancel the drag-and-drop process.
Execute end of drag-and-drop functions.
Inspect area below mouse for target objects while drag is performed.
Signal end of drag when the release pattern is triggered.
Factory function for drag-and-drop process.
另请参阅
Bindings and Events
tkinter.ttk — Tk 主题 Widget
tkinter.ttk
键入搜索术语或模块、类、函数名称。