[issue37039] IDLE: Improve zoomheight doc and behavior.

Tal Einat report at bugs.python.org
Mon May 27 16:28:44 EDT 2019


Tal Einat <taleinat at gmail.com> added the comment:

To get the maximum available height, does Tk's wm_maxsize() not work?

https://www.tcl.tk/man/tcl8.6/TkCmd/wm.htm#M54

Answering my own question above: No, it gives the total screen height, which doesn't ignore e.g. taskbars.

The best way to get the actual available height appears to be:
1. create a hidden window
2. maximize it with wm_state("zoomed")
3. get its height with winfo_height()

Testing on Windows, this does respect the taskbar, as well as scaling in the display settings. (Also note that Tk window heights appear not to include the window manager's title bar.)

I've yet to test on other OSs, but I've seen this method recommended before, and it has the potential to be robust.

Terry, would you like to see a PR with such an implementation?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37039>
_______________________________________


More information about the Python-bugs-list mailing list