From: Neil M. <ne...@cs...> - 2004-02-12 23:22:27
|
OK - final crack at this. There is a bug in there somewhere. Try this script: proc conf {x y w h} { puts "Geom: $x $y $w $h" wm geom .foo 100x[expr {$h-40}]+[expr {$x-100}]+[expr {$y+40}] } toplevel .foo bind . <Configure> [list conf %x %y %w %h] *This* script displays the bug. However, if you remove the wm geom command from the proc, everything works OK. I guess calling wm geom from a <Configure> event handler is a bad thing to do. However, it is being called on a different window, so I would expect it to work. Script above apparently works fine on Windows Tk, so I guess this is OS X/Aqua specific. Very weird bug, and quite unlikely to be run into. (By the way, the script is part of a poor-man's drawer-window I was playing with). Neil. On 12 Feb 2004, at 22:56, Neil Madden wrote: > Whoops! That script given works correctly... > > Looks like the bug was in my own <Configure> binding which seems to > have screwed something up somehow. There may be a bug here, but I need > to track it down further. Sorry for the noise, please ignore my > previous post. > > Neil. > > On 12 Feb 2004, at 22:33, Neil Madden wrote: > >> Got another one. This one's pretty bizarre. Try the following script: >> >> bind . <Configure> [list showInfo %W %x %y] >> proc showInfo {top x y} { >> puts "Geom = [winfo geom $top]" >> puts "x = $x y = $y" >> } >> >> Now move the window around. The behaviour I observe is that the >> initial values are correct. However, after the first move, the x >> field reduces by 99 while the y field reduces by 1 at each subsequent >> move. At some (seemingly random) point they return to the currently >> correct values, and then start cycling down again. Clicking on >> another window and then back on the main window causes correct >> results. Resizing or clicking the maximize (zoom) button gives >> right-ish results (zoom works, resizing gives correct width/height, >> but not x/y). >> >> I'm guessing a bug in the code which handles window movement. I'll >> track it down and submit a bug report to sf.net (hopefully with a >> patch, as I guess it's a simple error). >> >> -- Neil "stop finding bugs" Madden. >> >> >> >> ------------------------------------------------------- >> SF.Net is sponsored by: Speed Start Your Linux Apps Now. >> Build and deploy apps & Web services for Linux with >> a free DVD software kit from IBM. Click Now! >> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click >> _______________________________________________ >> Tcl-mac mailing list >> Tc...@li... >> https://lists.sourceforge.net/lists/listinfo/tcl-mac > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > Tcl-mac mailing list > Tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac |