maliang.standard¶
字数 11 个 阅读时间不到 1 分钟 访问量
源代码:maliang/standard/__init__.py
All standard things.
模块:
-
dialogs–All standard dialog classes
-
features–All standard
Featureclasses -
images–All standard
Imageclasses -
shapes–All standard
Shapeclasses -
styles–All standard
Styleclasses -
texts–All standard
Textclasses -
widgets–All standard
Widgetclasses
类:
-
TkMessage–Message pop-up
-
TkColorChooser–Color chooser pop-up
-
TkFontChooser–Font chooser pop-up
-
Text–Text widget, generally used to display plain text
-
Image–Image widget, generally used to display normal still image
-
Label–Label widget, which is generally used to display key information
-
Button–Button widget, typically used to trigger a function
-
Switch–Switch widget, typically used to control the turning of a function on and off
-
InputBox–Input box widget, generally used to enter certain information on a single line
-
CheckBox–Checkbox button widget, generally used to check some options
-
ToggleButton–A button that can display information and switch statuses
-
RadioBox–Radio button widget, generally used to select one of several options
-
ProgressBar–Progress bar widget, typically used to show the progress of an event
-
UnderlineButton–Underline button, generally used to display web links
-
HighlightButton–Highlight button, no outline, which added a highlight effect
-
IconButton–A button with an icon on the left side
-
Slider–A slider for visually resizing values
-
SegmentedButton–A segmented button that can be used to toggle between multiple states
-
SpinBox–A widget that makes it easy to enter numeric type data
-
OptionButton–A button that has many options to choose
-
ComboBox–An input box that can provide several options
-
Spinner–Spinners visually communicate that something is processing
-
Tooltip–A tooltip that can display additional information
TkMessage ¶
TkMessage(
message: str | None = None,
detail: str | None = None,
*,
title: str | None = None,
icon: typing.Literal["error", "info", "question", "warning"] = "info",
option: typing.Literal[
"abortretryignore", "ok", "okcancel", "retrycancel", "yesno", "yesnocancel"
] = "ok",
default: typing.Literal["abort", "retry", "ignore", "ok", "cancel", "yes", "no"] | None = None,
master: tkinter.Tk | None = None,
command: (
collections.abc.Callable[
[typing.Literal["abort", "retry", "ignore", "ok", "cancel", "yes", "no"]], typing.Any
]
| None
) = None
)
Message pop-up
message: messagedetail: detail messagetitle: title of the windowicon: iconoption: type of the message pop-updefault: button where the focus is, default is the leftmost onemaster: parent widget of the windowcommand: callback function
TkColorChooser ¶
TkColorChooser(
*,
title: str | None = None,
color: str | None = None,
master: tkinter.Tk | None = None,
command: collections.abc.Callable[[str], typing.Any] | None = None
)
Color chooser pop-up
title: title of the windowcolor: default colormaster: parent widget of the windowcommand: callback function
TkFontChooser ¶
TkFontChooser(
*,
title: str | None = None,
font: str | None = None,
master: tkinter.Tk | None = None,
command: collections.abc.Callable[[str], typing.Any] | None = None
)
Font chooser pop-up
title: title of the windowfont: default fontmaster: parent widget of the windowcommand: callback function
Text ¶
Text(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
*,
text: str = "",
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Text widget, generally used to display plain text
master: parent canvasposition: position of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
Image ¶
Image(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Image widget, generally used to display normal still image
master: parent canvasposition: position of the widgetsize: size of the widgetimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
Label ¶
Label(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
text: str = "",
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Label widget, which is generally used to display key information
master: parent canvasposition: position of the widgetsize: size of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
Button ¶
Button(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
text: str = "",
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
command: collections.abc.Callable | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Button widget, typically used to trigger a function
master: parent canvasposition: position of the widgetsize: size of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textcommand: a function that is triggered when the button is pressedimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
Switch ¶
Switch(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
length: int = 60,
*,
default: bool | None = None,
command: collections.abc.Callable[[bool], typing.Any] | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Switch widget, typically used to control the turning of a function on and off
master: parent canvasposition: position of the widgetlength: length of the widgetdefault: default value of the widgetcommand: a function that is triggered when the switch is changedimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
InputBox ¶
InputBox(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
align: typing.Literal["left", "right", "center"] = "left",
placeholder: str = "",
show: str | None = None,
ignore: tuple[str, ...] = ("\n", "\r"),
limit: int = math.inf,
limit_width: int = 0,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Input box widget, generally used to enter certain information on a single line
master: parent canvasposition: position of the widgetsize: size of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikealign: align mode of the textshow: display a value that obscures the original contentignore: ignore the input of some charactersplaceholder: a placeholder for the promptlimit: limit on the number of characterslimit_width: limit on the width of charactersimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
-
get–Get the value of the Entry
-
set–Set the text value of the Entry
-
insert–Insert
-
append–Append text to Entry
-
remove–Remove
-
pop–Delete a specified amount of text
-
clear–Clear the text value of the Entry
-
update–Update the widget.
CheckBox ¶
CheckBox(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
length: int = 30,
*,
default: bool | None = None,
command: collections.abc.Callable[[bool], typing.Any] | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Checkbox button widget, generally used to check some options
master: parent canvasposition: position of the widgetlength: length of the widgetdefault: default state of the widgetcommand: a function that is triggered when the state of check button is onimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
ToggleButton ¶
ToggleButton(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
text: str = "",
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
default: bool | None = None,
command: collections.abc.Callable[[bool], typing.Any] | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
A button that can display information and switch statuses
master: parent canvasposition: position of the widgetsize: size of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textdefault: default state of the widgetcommand: a function that is triggered when the state of check button is onimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
RadioBox ¶
RadioBox(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
length: int = 30,
*,
default: bool | None = None,
command: collections.abc.Callable[[int], typing.Any] | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Radio button widget, generally used to select one of several options
master: parent canvasposition: position of the widgetlength: length of the widgetdefault: default state of the widgetcommand: a function that is triggered when the state of radio button is onimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
ProgressBar ¶
ProgressBar(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] = (400, 20),
*,
default: float | None = None,
command: collections.abc.Callable[[float], typing.Any] | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Progress bar widget, typically used to show the progress of an event
master: parent canvasposition: position of the widgetsize: size of the widgetdefault: default value of the widgetcommand: a function that is triggered when the progress of progress bar is 100%image: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
UnderlineButton ¶
UnderlineButton(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
*,
text: str = "",
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
command: collections.abc.Callable | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool = False,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Underline button, generally used to display web links
master: parent canvasposition: position of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textcommand: a function that is triggered when the underline button is pressedimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
HighlightButton ¶
HighlightButton(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
*,
text: str = "",
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
command: collections.abc.Callable | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Highlight button, no outline, which added a highlight effect
master: parent canvasposition: position of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textcommand: a function that is triggered when the hightlight button is pressedimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
IconButton ¶
IconButton(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
text: str = "",
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
command: collections.abc.Callable | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
A button with an icon on the left side
master: parent canvasposition: position of the widgetsize: size of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textcommand: a function that is triggered when the button is pressedimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
Slider ¶
Slider(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] = (400, 30),
*,
default: float | None = None,
command: collections.abc.Callable[[float], typing.Any] | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
A slider for visually resizing values
master: parent canvasposition: position of the widgetsize: size of the widgetdefault: default value of the widgetcommand: a function that is triggered when the button is pressedanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
SegmentedButton ¶
SegmentedButton(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
sizes: tuple[tuple[int, int], ...] = (),
*,
text: tuple[str, ...] = (),
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
default: int | None = None,
command: collections.abc.Callable[[int | None], typing.Any] | None = None,
image: tuple[enhanced.PhotoImage | None, ...] = (),
layout: typing.Literal["horizontal", "vertical"] = "horizontal",
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
A segmented button that can be used to toggle between multiple states
master: parent canvasposition: position of the widgetsize: size of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textdefault: default value of the widgetcommand: a function that is triggered when the button is pressedimage: image of the widgetlayout: layout mode of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
SpinBox ¶
SpinBox(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
format_spec: str = "d",
step: int = 1,
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
align: typing.Literal["left", "right", "center"] = "left",
placeholder: str = "",
show: str | None = None,
limit: int = math.inf,
default: str | None = None,
command: collections.abc.Callable[[bool], typing.Any] | None = None,
image: enhanced.PhotoImage | None = None,
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
A widget that makes it easy to enter numeric type data
master: parent canvasposition: position of the widgetsize: size of the widgetformat_spec: format of valuestep: value of each changefamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikealign: align mode of the textshow: display a value that obscures the original contentplaceholder: a placeholder for the promptlimit: limit on the number of charactersdefault: default value of the widgetcommand: a function that is triggered when the button is pressedimage: image of the widgetanchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
-
change–Try change the current value
-
get–Get the value of the Entry
-
set–Set the text value of the Entry
-
append–Append text to Entry
-
delete–Delete a specified amount of text
-
clear–Clear the text value of the Entry
OptionButton ¶
OptionButton(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
text: tuple[str, ...] = (),
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
default: int | None = None,
command: collections.abc.Callable[[int | None], typing.Any] | None = None,
image: tuple[enhanced.PhotoImage | None, ...] = (),
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
align: typing.Literal["up", "center", "down"] = "center",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
A button that has many options to choose
master: parent canvasposition: position of the widgetsize: size of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textdefault: default value of the widgetcommand: a function that is triggered when the button is pressedimage: image of the widgetanchor: anchor of the widgetalign: align of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
ComboBox ¶
ComboBox(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] | None = None,
*,
text: tuple[str, ...] = (),
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
default: int | None = None,
command: collections.abc.Callable[[int | None], typing.Any] | None = None,
image: tuple[enhanced.PhotoImage | None, ...] = (),
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
align: typing.Literal["up", "down"] = "down",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
An input box that can provide several options
master: parent canvasposition: position of the widgetsize: size of the widgettext: text of the widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textdefault: default value of the widgetcommand: a function that is triggered when the button is pressedimage: image of the widgetanchor: anchor of the widgetalign: align of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
Spinner ¶
Spinner(
master: containers.Canvas | virtual.Widget,
position: tuple[int, int],
size: tuple[int, int] = (30, 30),
*,
default: float | None = None,
command: collections.abc.Callable[[float], typing.Any] | None = None,
widths: tuple[int, int] | None = None,
mode: typing.Literal["determinate", "indeterminate"] = "determinate",
anchor: typing.Literal["n", "e", "w", "s", "nw", "ne", "sw", "se", "center"] = "nw",
capture_events: bool | None = None,
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
Spinners visually communicate that something is processing
master: parent canvasposition: position of the widgetsize: size of the widgetdefault: default value of the widgetcommand: a function that is triggered when the progress of progress bar is 100%widths: width of the outside ring and inside ringmode: mode of the Spinneranchor: anchor of the widgetcapture_events: whether detect another widget under the widgetgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法:
Tooltip ¶
Tooltip(
widget: virtual.Widget,
size: tuple[int, int] | None = None,
*,
text: str = "",
align: typing.Literal["up", "down", "right", "left", "center"] = "down",
padding: int = 3,
family: str | None = None,
fontsize: int | None = None,
weight: typing.Literal["normal", "bold"] = "normal",
slant: typing.Literal["roman", "italic"] = "roman",
underline: bool = False,
overstrike: bool = False,
justify: typing.Literal["left", "center", "right"] = "left",
gradient_animation: bool | None = None,
auto_update: bool | None = None,
style: type[virtual.Style] | None = None
)
A tooltip that can display additional information
widget: the associated widgetsize: size of the widgettext: text of the widgetalign: align mode of the tooltippadding: extra padding between tooltip and the associated widgetfamily: font familyfontsize: font sizeweight: weight of the textslant: slant of the textunderline: whether the text is underlineoverstrike: whether the text is overstrikejustify: justify mode of the textgradient_animation: whether enable gradient_animationauto_update: whether the theme manager update it automaticallystyle: style of the widget
方法: