首页 > 解决方案 > Tkinter 如何在 Microsoft Windows 上工作?

问题描述

我正在阅读 Tkinter 上有关 Windows 管理器处理的某些操作的文章,我想知道 Tkinter 究竟是如何与操作系统的窗口管理器通信的?根据文档,它使用 Xlib 来绘制图形,但它在 Microsoft Windows 上是如何工作的?Xlib 不是类似 Unix 的图形库,即 X11 吗?Tkinter 究竟是如何与 Windows 图形通信的?Windows 版本的 Python 是否可以访问 WinAPI 并且不使用 Xlib?

标签: pythonuser-interfacetkinter

解决方案


Tk (the library upon which tkinter is base) uses the windows API on windows, and cocoa libraries on OSX. Those two platforms don't use xlib, though it is possible to compile X11-based versions on those platforms if you wish.

A lot of information about the windows port of tcl/tk is available on the Tcl wiki: https://wiki.tcl-lang.org/page/Microsoft+Windows+and+Tcl


推荐阅读