mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Add name field to tk widgets (#4867)
This commit is contained in:
@@ -886,6 +886,7 @@ class Button(Widget):
|
||||
highlightthickness: _ScreenUnits = ...,
|
||||
image: _ImageSpec = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
overrelief: _Relief = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
@@ -1010,6 +1011,7 @@ class Canvas(Widget, XView, YView):
|
||||
insertofftime: int = ...,
|
||||
insertontime: int = ...,
|
||||
insertwidth: _ScreenUnits = ...,
|
||||
name: str = ...,
|
||||
offset: Any = ..., # undocumented
|
||||
relief: _Relief = ...,
|
||||
# Setting scrollregion to None doesn't reset it back to empty,
|
||||
@@ -1212,6 +1214,7 @@ class Checkbutton(Widget):
|
||||
image: _ImageSpec = ...,
|
||||
indicatoron: bool = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
offrelief: _Relief = ...,
|
||||
# The checkbutton puts a value to its variable when it's checked or
|
||||
# unchecked. We don't restrict the type of that value here, so
|
||||
@@ -1369,6 +1372,7 @@ class Entry(Widget, XView):
|
||||
invalidcommand: _EntryValidateCommand = ...,
|
||||
invcmd: _EntryValidateCommand = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
readonlybackground: _Color = ...,
|
||||
relief: _Relief = ...,
|
||||
selectbackground: _Color = ...,
|
||||
@@ -1492,6 +1496,7 @@ class Frame(Widget):
|
||||
highlightbackground: _Color = ...,
|
||||
highlightcolor: _Color = ...,
|
||||
highlightthickness: _ScreenUnits = ...,
|
||||
name: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
relief: _Relief = ...,
|
||||
@@ -1586,6 +1591,7 @@ class Label(Widget):
|
||||
highlightthickness: _ScreenUnits = ...,
|
||||
image: _ImageSpec = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
relief: _Relief = ...,
|
||||
@@ -1704,6 +1710,7 @@ class Listbox(Widget, XView, YView):
|
||||
# >>> lb.get(0, 'end')
|
||||
# ('foo', 'bar', 'baz')
|
||||
listvariable: Variable = ...,
|
||||
name: str = ...,
|
||||
relief: _Relief = ...,
|
||||
selectbackground: _Color = ...,
|
||||
selectborderwidth: _ScreenUnits = ...,
|
||||
@@ -1827,6 +1834,7 @@ class Menu(Widget):
|
||||
fg: _Color = ...,
|
||||
font: _FontDescription = ...,
|
||||
foreground: _Color = ...,
|
||||
name: str = ...,
|
||||
postcommand: Union[Callable[[], Any], str] = ...,
|
||||
relief: _Relief = ...,
|
||||
selectcolor: _Color = ...,
|
||||
@@ -1963,6 +1971,7 @@ class Menubutton(Widget):
|
||||
indicatoron: bool = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
menu: Menu = ...,
|
||||
name: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
relief: _Relief = ...,
|
||||
@@ -2065,6 +2074,7 @@ class Message(Widget):
|
||||
highlightcolor: _Color = ...,
|
||||
highlightthickness: _ScreenUnits = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
relief: _Relief = ...,
|
||||
@@ -2180,6 +2190,7 @@ class Radiobutton(Widget):
|
||||
image: _ImageSpec = ...,
|
||||
indicatoron: bool = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
offrelief: _Relief = ...,
|
||||
overrelief: _Relief = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
@@ -2318,6 +2329,7 @@ class Scale(Widget):
|
||||
highlightthickness: _ScreenUnits = ...,
|
||||
label: str = ...,
|
||||
length: _ScreenUnits = ...,
|
||||
name: str = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
relief: _Relief = ...,
|
||||
repeatdelay: int = ...,
|
||||
@@ -2431,6 +2443,7 @@ class Scrollbar(Widget):
|
||||
highlightcolor: _Color = ...,
|
||||
highlightthickness: _ScreenUnits = ...,
|
||||
jump: bool = ...,
|
||||
name: str = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
relief: _Relief = ...,
|
||||
repeatdelay: int = ...,
|
||||
@@ -2560,6 +2573,7 @@ class Text(Widget, XView, YView):
|
||||
insertunfocussed: Literal["none", "hollow", "solid"] = ...,
|
||||
insertwidth: _ScreenUnits = ...,
|
||||
maxundo: int = ...,
|
||||
name: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
relief: _Relief = ...,
|
||||
@@ -2965,6 +2979,7 @@ class Spinbox(Widget, XView):
|
||||
invalidcommand: _EntryValidateCommand = ...,
|
||||
invcmd: _EntryValidateCommand = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
readonlybackground: _Color = ...,
|
||||
relief: _Relief = ...,
|
||||
repeatdelay: int = ...,
|
||||
@@ -3118,6 +3133,7 @@ class LabelFrame(Widget):
|
||||
# 'ne' and 'en' are valid labelanchors, but only 'ne' is a valid _Anchor.
|
||||
labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ...,
|
||||
labelwidget: Misc = ...,
|
||||
name: str = ...,
|
||||
padx: _ScreenUnits = ...,
|
||||
pady: _ScreenUnits = ...,
|
||||
relief: _Relief = ...,
|
||||
@@ -3197,6 +3213,7 @@ class PanedWindow(Widget):
|
||||
handlepad: _ScreenUnits = ...,
|
||||
handlesize: _ScreenUnits = ...,
|
||||
height: _ScreenUnits = ...,
|
||||
name: str = ...,
|
||||
opaqueresize: bool = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
proxybackground: _Color = ...,
|
||||
|
||||
@@ -61,6 +61,7 @@ class Button(Widget):
|
||||
cursor: tkinter._Cursor = ...,
|
||||
default: Literal["normal", "active", "disabled"] = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
name: str = ...,
|
||||
padding: Any = ..., # undocumented
|
||||
state: Literal["normal", "disabled"] = ...,
|
||||
style: str = ...,
|
||||
@@ -124,6 +125,7 @@ class Checkbutton(Widget):
|
||||
compound: _TtkCompound = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
name: str = ...,
|
||||
offvalue: Any = ...,
|
||||
onvalue: Any = ...,
|
||||
padding: Any = ..., # undocumented
|
||||
@@ -200,6 +202,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
foreground: tkinter._Color = ...,
|
||||
invalidcommand: tkinter._EntryValidateCommand = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
show: str = ...,
|
||||
state: Literal["normal", "disabled", "readonly"] = ...,
|
||||
style: str = ...,
|
||||
@@ -301,6 +304,7 @@ class Combobox(Entry):
|
||||
height: int = ...,
|
||||
invalidcommand: tkinter._EntryValidateCommand = ..., # undocumented
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
postcommand: Union[Callable[[], Any], str] = ...,
|
||||
show: Any = ..., # undocumented
|
||||
state: Literal["normal", "readonly", "disabled"] = ...,
|
||||
@@ -386,6 +390,7 @@ class Frame(Widget):
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
height: tkinter._ScreenUnits = ...,
|
||||
name: str = ...,
|
||||
padding: tkinter._Padding = ...,
|
||||
relief: tkinter._Relief = ...,
|
||||
style: str = ...,
|
||||
@@ -452,6 +457,7 @@ class Label(Widget):
|
||||
foreground: tkinter._Color = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
justify: Literal["left", "center", "right"] = ...,
|
||||
name: str = ...,
|
||||
padding: tkinter._Padding = ...,
|
||||
relief: tkinter._Relief = ...,
|
||||
state: Literal["normal", "disabled"] = ...,
|
||||
@@ -523,6 +529,7 @@ class Labelframe(Widget):
|
||||
height: tkinter._ScreenUnits = ...,
|
||||
labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ...,
|
||||
labelwidget: tkinter.Misc = ...,
|
||||
name: str = ...,
|
||||
padding: tkinter._Padding = ...,
|
||||
relief: tkinter._Relief = ..., # undocumented
|
||||
style: str = ...,
|
||||
@@ -585,6 +592,7 @@ class Menubutton(Widget):
|
||||
direction: Literal["above", "below", "left", "right", "flush"] = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
menu: tkinter.Menu = ...,
|
||||
name: str = ...,
|
||||
padding: Any = ..., # undocumented
|
||||
state: Literal["normal", "disabled"] = ...,
|
||||
style: str = ...,
|
||||
@@ -628,6 +636,7 @@ class Notebook(Widget):
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
height: int = ...,
|
||||
name: str = ...,
|
||||
padding: tkinter._Padding = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
@@ -671,6 +680,7 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
cursor: tkinter._Cursor = ...,
|
||||
# width and height for tkinter.ttk.Panedwindow are int but for tkinter.PanedWindow they are screen units
|
||||
height: int = ...,
|
||||
name: str = ...,
|
||||
orient: Literal["vertical", "horizontal"] = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
@@ -725,6 +735,7 @@ class Progressbar(Widget):
|
||||
length: tkinter._ScreenUnits = ...,
|
||||
maximum: float = ...,
|
||||
mode: Literal["determinate", "indeterminate"] = ...,
|
||||
name: str = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
phase: int = ..., # docs say read-only but assigning int to this works
|
||||
style: str = ...,
|
||||
@@ -784,6 +795,7 @@ class Radiobutton(Widget):
|
||||
compound: _TtkCompound = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
name: str = ...,
|
||||
padding: Any = ..., # undocumented
|
||||
state: Literal["normal", "disabled"] = ...,
|
||||
style: str = ...,
|
||||
@@ -835,6 +847,7 @@ class Scale(Widget, tkinter.Scale):
|
||||
cursor: tkinter._Cursor = ...,
|
||||
from_: float = ...,
|
||||
length: tkinter._ScreenUnits = ...,
|
||||
name: str = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
state: Any = ..., # undocumented
|
||||
style: str = ...,
|
||||
@@ -895,6 +908,7 @@ class Scrollbar(Widget, tkinter.Scrollbar):
|
||||
class_: str = ...,
|
||||
command: Union[Callable[..., Optional[Tuple[float, float]]], str] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
name: str = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
@@ -937,6 +951,7 @@ class Separator(Widget):
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
name: str = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
@@ -965,6 +980,7 @@ class Sizegrip(Widget):
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
name: str = ...,
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
) -> None: ...
|
||||
@@ -1026,6 +1042,7 @@ if sys.version_info >= (3, 7):
|
||||
increment: float = ...,
|
||||
invalidcommand: tkinter._EntryValidateCommand = ..., # undocumented
|
||||
justify: Literal["left", "center", "right"] = ..., # undocumented
|
||||
name: str = ...,
|
||||
show: Any = ..., # undocumented
|
||||
state: Literal["normal", "disabled"] = ...,
|
||||
style: str = ...,
|
||||
@@ -1099,6 +1116,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
cursor: tkinter._Cursor = ...,
|
||||
displaycolumns: Union[str, tkinter._TkinterSequence[str], tkinter._TkinterSequence[int], Literal["#all"]] = ...,
|
||||
height: int = ...,
|
||||
name: str = ...,
|
||||
padding: tkinter._Padding = ...,
|
||||
selectmode: Literal["extended", "browse", "none"] = ...,
|
||||
# _TkinterSequences of Literal don't actually work, using str instead.
|
||||
|
||||
Reference in New Issue
Block a user