move DndSource to tkinter/dnd.pyi (#5588)

This commit is contained in:
Akuli
2021-06-07 17:07:57 +03:00
committed by GitHub
parent ec80fdaeb5
commit 200260e685
3 changed files with 6 additions and 12 deletions

View File

@@ -1,10 +1,12 @@
from _typeshed.tkinter import DndSource
from tkinter import Event, Misc, Tk
from typing import ClassVar, Optional
from tkinter import Event, Misc, Tk, Widget
from typing import ClassVar, Optional, Protocol
class _DndSource(Protocol):
def dnd_end(self, target: Optional[Widget], event: Optional[Event[Misc]]) -> None: ...
class DndHandler:
root: ClassVar[Optional[Tk]]
def __init__(self, source: DndSource, event: Event[Misc]) -> None: ...
def __init__(self, source: _DndSource, event: Event[Misc]) -> None: ...
def cancel(self, event: Optional[Event[Misc]] = ...) -> None: ...
def finish(self, event: Optional[Event[Misc]], commit: int = ...) -> None: ...
def on_motion(self, event: Event[Misc]) -> None: ...