Message343689
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? |
|
Date |
User |
Action |
Args |
2019-05-27 20:28:44 | taleinat | set | recipients:
+ taleinat, terry.reedy, aroberge, serhiy.storchaka, cheryl.sabella |
2019-05-27 20:28:44 | taleinat | set | messageid: <1558988924.44.0.713635057662.issue37039@roundup.psfhosted.org> |
2019-05-27 20:28:44 | taleinat | link | issue37039 messages |
2019-05-27 20:28:44 | taleinat | create | |
|