mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
move DndSource to tkinter/dnd.pyi (#5588)
This commit is contained in:
@@ -50,7 +50,6 @@ _threading_local: 3.6-
|
||||
_tkinter: 2.7-
|
||||
_tracemalloc: 3.6-
|
||||
_typeshed: 2.7- # not present at runtime, only for type checking
|
||||
_typeshed.tkinter: 3.0-
|
||||
_warnings: 2.7-
|
||||
_weakref: 2.7-
|
||||
_weakrefset: 2.7-
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# See the README.md file in this directory for more information.
|
||||
|
||||
from tkinter import Event, Misc, Widget
|
||||
from typing import Optional, Protocol
|
||||
|
||||
class DndSource(Protocol):
|
||||
def dnd_end(self, target: Optional[Widget], event: Optional[Event[Misc]]) -> None: ...
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user