Python tkinter ttk 主题是否基于操作系统可用

Are Python tkinter ttk themes available based on the operating system

我正在使用 Python 3.5.2 和 tkinter.ttk 模块在 Linux (Kubuntu 16.04) 上开发一个简单的 GUI 实用程序。我的ttk.__version__ == 0.3.1。有四个可用的小部件主题:'clam', 'alt', 'classic', 'default'。我在别处看到其他安装有更多选择。

每个 OS 都可以下载和安装吗?我想知道是否其他主题不一定是跨平台的,并且可能是为某些 OS 设计的?

注意: 我是编写 GUI 的新手。

我不认为它们是(全部)cross-platform,这不仅来自我的经验,还来自论文“The Tile Widget Set”(第 1-2 页)的以下摘录Joe English,2004 年(有点旧,但我认为这些东西今天仍然有效)。

Figure 1 shows 3 different buttons. The first is a classic Motif-style button. Notice the outer highlight ring (indicating keyboard focus) and the thick inner border (indicating that this is the "default" button). The second is a Windows-style button: it has a slightly different border and the focus indicator is a dashed box drawn inside the border instead of a solid box on the outside. The third button is a different possibility altogether.

Except those aren't really three different buttons: it's actually the same button drawn under three different themes.

The Tile package includes several built-in themes. The default theme on X11 has a new, streamlined look; a classic theme implementing Tk's current Motif-like appearance is also available.

On Windows XP, the xpnative theme uses the Windows "Visual Styles" API to make Tk widgets indistinguishable from native controls. On other versions of Windows, the winnative theme matches the Microsoft Windows User Experience guidelines.

On Mac OSX, the aqua theme uses the Carbon Appearance Manager for (almost-)native appearance on that platform.

New themes can be implemented as add-on packages written in Tcl or in C, depending on the level of customization required.

A Tile theme is a collection of elements, layouts, and styles, which are combined with widget options to determine the look and feel.

所以,总而言之,有针对不同操作系统的自定义主题。您也可以使用 C 或 Tcl 来实现。