跳转至

maliang.standard.dialogs

字数 9 个   阅读时间不到 1 分钟   访问量

源代码:maliang/standard/dialogs.py

All standard dialog classes

类:

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: message
  • detail: detail message
  • title: title of the window
  • icon: icon
  • option: type of the message pop-up
  • default: button where the focus is, default is the leftmost one
  • master: parent widget of the window
  • command: 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 window
  • color: default color
  • master: parent widget of the window
  • command: 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 window
  • font: default font
  • master: parent widget of the window
  • command: callback function