mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
make tkinter.font.Font behave similarly to tkinter widgets (#4469)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import tkinter
|
||||
from typing import List, Optional, Tuple, TypeVar, Union, overload
|
||||
from typing import Any, List, Optional, Tuple, TypeVar, Union, overload
|
||||
from typing_extensions import Literal, TypedDict
|
||||
|
||||
NORMAL: Literal["normal"]
|
||||
@@ -48,6 +48,8 @@ class Font:
|
||||
underline: bool = ...,
|
||||
overstrike: bool = ...,
|
||||
) -> None: ...
|
||||
def __getitem__(self, key: str) -> Any: ...
|
||||
def __setitem__(self, key: str, value: Any) -> None: ...
|
||||
@overload
|
||||
def cget(self, option: Literal["family"]) -> str: ...
|
||||
@overload
|
||||
@@ -58,7 +60,6 @@ class Font:
|
||||
def cget(self, option: Literal["slant"]) -> Literal["roman", "italic"]: ...
|
||||
@overload
|
||||
def cget(self, option: Literal["underline", "overstrike"]) -> Literal[0, 1]: ...
|
||||
__getitem__ = cget
|
||||
@overload
|
||||
def actual(self, option: Literal["family"], displayof: Optional[tkinter.Misc] = ...) -> str: ...
|
||||
@overload
|
||||
@@ -73,18 +74,6 @@ class Font:
|
||||
def actual(self, option: None, displayof: Optional[tkinter.Misc] = ...) -> _FontDict: ...
|
||||
@overload
|
||||
def actual(self, *, displayof: Optional[tkinter.Misc] = ...) -> _FontDict: ...
|
||||
@overload
|
||||
def __setitem__(self, key: Literal["family"], value: str) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, key: Literal["size"], value: int) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, key: Literal["weight"], value: Literal["normal", "bold"]) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, key: Literal["slant"], value: Literal["roman", "italic"]) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, key: Literal["underline"], value: bool) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, key: Literal["overstrike"], value: bool) -> None: ...
|
||||
def config(
|
||||
self,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user