-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add missing tkinter submodules #4558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1fe8807
cfcc1e6
de53c30
83fc509
47e0043
37ca086
4fb1eb8
184743e
ee06c7f
8465e70
b29cba6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import sys | ||
from typing import Optional, Protocol | ||
|
||
if sys.version_info >= (3,): | ||
from tkinter import Event, Misc, Widget | ||
class DndSource(Protocol): | ||
def dnd_end(self, target: Optional[Widget], event: Optional[Event[Misc]]) -> None: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from tkinter.commondialog import Dialog | ||
from typing import Any, ClassVar, Optional, Tuple, Union | ||
|
||
class Chooser(Dialog): | ||
command: ClassVar[str] | ||
|
||
def askcolor( | ||
color: Optional[Union[str, bytes]] = ..., **options: Any | ||
) -> Union[Tuple[None, None], Tuple[Tuple[float, float, float], str]]: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from _typeshed.tkinter import DndSource | ||
from tkinter import Event, Misc, Tk | ||
from typing import ClassVar, Optional | ||
|
||
class DndHandler: | ||
root: ClassVar[Optional[Tk]] | ||
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: ... | ||
def on_release(self, event: Event[Misc]) -> None: ... | ||
|
||
def dnd_start(source, event) -> Optional[DndHandler]: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from tkinter import Frame, Grid, Misc, Pack, Place, Scrollbar, Text | ||
from typing import Any, Optional | ||
|
||
# The methods from Pack, Place, and Grid are dynamically added over the parent's impls | ||
class ScrolledText(Text): | ||
frame: Frame | ||
vbar: Scrollbar | ||
def __init__(self, master: Optional[Misc] = ..., **kwargs: Any) -> None: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from tkinter import Event, Misc, Toplevel | ||
from typing import Any, List, Optional | ||
|
||
class Dialog(Toplevel): | ||
def __init__(self, parent: Optional[Misc], title: Optional[str] = ...) -> None: ... | ||
def body(self, master) -> None: ... | ||
def buttonbox(self): ... | ||
|
||
class SimpleDialog: | ||
def __init__( | ||
self, | ||
master: Optional[Misc], | ||
text: str = ..., | ||
buttons: List[str] = ..., | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be |
||
default: Optional[int] = ..., | ||
cancel: Optional[int] = ..., | ||
title: Optional[str] = ..., | ||
class_: Optional[str] = ..., | ||
) -> None: ... | ||
def go(self) -> Optional[int]: ... | ||
def return_event(self, event: Event[Misc]) -> None: ... | ||
def wm_delete_window(self) -> None: ... | ||
def done(self, num: int) -> None: ... | ||
|
||
def askfloat(title: Optional[str], prompt: str, **kwargs: Any) -> float: ... | ||
def askinteger(title: Optional[str], prompt: str, **kwargs: Any) -> int: ... | ||
def askstring(title: Optional[str], prompt: str, **kwargs: Any) -> str: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be a
ClassVar
. It's set in__init__
.