Author taleinat
Recipients aroberge, cheryl.sabella, serhiy.storchaka, taleinat, terry.reedy
Date 2019-05-27.20:28:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558988924.44.0.713635057662.issue37039@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2019-05-27 20:28:44taleinatsetrecipients: + taleinat, terry.reedy, aroberge, serhiy.storchaka, cheryl.sabella
2019-05-27 20:28:44taleinatsetmessageid: <1558988924.44.0.713635057662.issue37039@roundup.psfhosted.org>
2019-05-27 20:28:44taleinatlinkissue37039 messages
2019-05-27 20:28:44taleinatcreate