Tkinter: winfo_screenmmwidth discussion

josefg at josefg at
Tue Nov 26 23:13:57 CET 2013

I am currently using Windows 7 Sp1, Tkinter 8.5, Python 2.7.4 on a laptop with no attached monitor. I am attempting to use winfo_screenmmwidth, but the returned value is incorrect. Specs state 280 mm. Physical measurement is 275 mm. EDID states 280 mm. Tkinter's winfo_screenmmwidth returns 361 mm. I don't have very much tkinter experience, please bear with me.

>From where does winfo_screenmmheight get this information? I have looked through the source code and can't really find the source. The source code seems to lead to WidthMMOfScreen(Screen(tkwin)) in both tkGet.c and tkObj.c. Xlib.h defines the Screen structure which has mwidth defined in it. Xlib.h also defines WidthMMOfScreen as a macro "#define WidthMMOfScreen(s)	((s)->mwidth)" The X Window System Protocol:8 Connection Setup:Screen Information states "Width-in-millimeters and height-in-millimeters can be used to determine the physical size and the aspect ratio," but I'm not sure where the code is for the request.

So that's where I stopped on the X Windows side of things. I think I need to look at the source code for _tkinter.lib, but I'm not sure. I downloaded and started to look at the pywin32.exe (win32all) source code, but I'm not sure where to start with that either. I was expecting to see an entry which returns the EDID information, but I have not seen that yet.

Could somebody point me in the right direction? Or does anyone have any ideas?

Thank you in advance.

More information about the Python-list mailing list