简体   繁体   中英

How does Tkinter work on Microsoft Windows?

I was reading the up on Tkinter for certain operations that the windows manager handles and I got to wondering how exactly does Tkinter communicate with the OS's window manager? Per the docs it uses Xlib to draw graphics, but how does that work on Microsoft Windows? Isn't Xlib a Unix-like grahpics library, ie X11? How exactly does Tkinter communicate with Windows graphics? Does the Windows version of Python have access to the WinAPI and doesnt use Xlib?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM