Python: Tkinter/ttk themed Message Box

后端 未结 3 2027
情歌与酒
情歌与酒 2021-01-02 07:22

I started making a GUI with Tkinter and I added the module tkMessageBox as well. But recently I discovered that importing the module

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-02 07:41

    From the docs:

    Starting with Tk 8.5, the ttk module became available. This module replaces much (but not all) of the original Tkinter machinery. Use this module to gain these advantages:
    • Platform-specific appearance. In releases before Tk 8.5, one of the commonest complaints about Tk applications was that they did not conform to the style of the various platforms.

    • The ttk module allows you to write your application in a generic way, yet your application can look like a Windows application under Windows, like a MacOS app under MacOS, and so on, without any change to your program.

    • Each possible different appearance is represented by a named ttk theme. For example, the classic theme gives you the appearance of the original Tkinter widgets described in the previous sections.

    ttk uses the system styles to represent something. Tkinter does not. It is its own style.

提交回复
热议问题