wm attributes $::w -zoomed 1
update idletasks
regsub {([0-9]+)x.+} [winfo geometry $::w] {\1} ::WholeAppWidth
The whole app width I'm getting is 600 - out of 600x381+817+515.
But 600 is incorrect. I am making sure the application always runs
maximized, and my screen is 1920px wide.
The height can't be 381px either.
The x/y coordinates are also wrong. If the application is maximized,
they should be 0+0 (or maybe 1+1).
What am I doing wrong this time?
wm attributes $::w -zoomed 1
update idletasks
regsub {([0-9]+)x.+} [winfo geometry $::w] {\1} ::WholeAppWidth
The whole app width I'm getting is 600 - out of 600x381+817+515.
But 600 is incorrect. I am making sure the application always runs
maximized, and my screen is 1920px wide.
The height can't be 381px either.
The x/y coordinates are also wrong. If the application is maximized,
they should be 0+0 (or maybe 1+1).
What am I doing wrong this time?
If the state is zoomed, the last state normal geometry is returned.
I would check the winfo height/width of "." to get current zoomed size.
Harald
1) try an update instead of an update idletasks
and it avoids
doing a full update (or update idletasks).
On Mon, 15 May 2023 03:57:40 -0000 (UTC), Rich wrote:
1) try an update instead of an update idletasks
That works, but I will have to look into the <Configure> option too
because the window may be resized by the user and the application will
have to self adjust accordingly.
and it avoids
doing a full update (or update idletasks).
You say that like it's a bad thing. Is it? What is the problem with
"a full update"?
On Mon, 15 May 2023 03:57:40 -0000 (UTC), Rich wrote:
1) try an update instead of an update idletasks
That works, but I will have to look into the <Configure> option too
because the window may be resized by the user and the application will
have to self adjust accordingly.
and it avoids doing a full update (or update idletasks).
You say that like it's a bad thing. Is it? What is the problem with
"a full update"?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 498 |
Nodes: | 16 (0 / 16) |
Uptime: | 74:08:23 |
Calls: | 9,819 |
Calls today: | 7 |
Files: | 13,757 |
Messages: | 6,189,860 |