* Rich <
[email protected]d>
| Luc <
[email protected]d> wrote:
| > 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.
| In this case, you *will* want to bind to the <Configure> event, because
| if you have need to know what size the user resized things to, binding
| to <Configure> is the only reliable way to do so.
Note that the <Configure> event will also trigger the first time the
window appears on the screen and is mapped to it's first 'real' size:
% cat t.tcl
proc showgeom {msg} {
puts "$msg: geom [winfo geometry .] w [winfo width .] h [winfo height .]"
}
showgeom "at start"
bind . <Configure> [list showgeom "via Configure"]
% wish t.tcl
at start: geom 1x1+0+0 w 1 h 1
via Configure: geom 200x200+0+0 w 200 h 200
via Configure: geom 200x200+148+372 w 200 h 200
via Configure: geom 200x200+148+372 w 200 h 200
R'
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)