hello... this is not good enough I think, I tested it and it's wrong... I found this : http://wiki.tcl.tk/11291 from which I supposed you got that code.. but it's not good because it doesn't check for the border height of a window (the decorations) so here's a code that I was able to write to fix this issue. Note also that I wasn't able to find a way to avoid the flickering because if I do a 'wm withdraw $w', then even after the 'update', the width/height/etc.. of the window do not get updated... ohhh, I remember a bug in Tk (or is it a bug?) that I noticed many times while working with chameleon plugin! The bug was that a toplevel without background is transparent.. but not in the true sens of 'transparent' (which is why I call it a 'bug' not a feature).. just try this : 'toplevel .test -bg {}' (it has to be an empty list), you'll see that the window inherits the background of what was in its place before it appeared, but it's not really transparent because if you move it, it keeps that background and if you overlap something OVER it and move it, you'll see that the image bugs... BUT I just tried that and it WORKED! setting the toplevel with an empty background avoids the flickering.. there probably is a flickering, but so small (only decorations) that we can't even see it. Actually, only the border will (sometimes) flicker but SO fast that you won't be able to see it unless you run the proc in a loop. So this fixes the issue! :) Here is the code... please note that this does NOT check for a taskbar that could be positioned on the side (yes, people do position their taskbar on the right side of the screen) so the code is incomplete.. but the same algorithm should be used to check the screen widht.. in that case, borders would not apply in the equation).. the proc should become "getLowerRightCornerPositionExcludingTaskbar" because .. well it's self explanatory! :) Anyways, here's the code. I tested it with different taskbar positions and actually tried creating a window to that offset and that offset + 1, and it is indeed THE offset :) have fun! : proc getTaskbarHeight { {w .taskBarHeightTester} } { destroy $w toplevel $w -bg {} wm state $w zoomed update set border_height [winfo rooty $w] set screen_height [winfo screenheight $w] set window_height [winfo height $w] set taskbar_height [expr $screen_height - $window_height - $border_height] destroy $w return $taskbar_height }
Have fun! p.s.: This was a great idea Alvaro! KKRT On Fri, Aug 18, 2006 at 02:50:32AM -0700, [EMAIL PROTECTED] wrote: > Revision: 7134 > Author: airadier > Date: 2006-08-18 02:50:27 -0700 (Fri, 18 Aug 2006) > ViewCVS: http://svn.sourceforge.net/amsn/?rev=7134&view=rev > > Log Message: > ----------- > Added getTaskbarHeight procedure (proc name is self-descriptive), but not > using it, small flicker when called. TODO: May be useful for finding out > notify window offset? > > Modified Paths: > -------------- > trunk/amsn/preferences.tcl > Modified: trunk/amsn/preferences.tcl > =================================================================== > --- trunk/amsn/preferences.tcl 2006-08-18 09:46:36 UTC (rev 7133) > +++ trunk/amsn/preferences.tcl 2006-08-18 09:50:27 UTC (rev 7134) > @@ -2559,6 +2559,16 @@ > > } > > +proc getTaskbarHeight {{w .taskBarSize}} { > + catch {destroy $w} > + toplevel $w > + wm state $w zoomed > + update > + set val [expr {[winfo screenheight $w]-[winfo height $w]}] > + destroy $w > + return $val; > +} > + > #check if a window is outside the screen and move it in > proc moveinscreen {window {mindist 0}} { > > > > This was sent by the SourceForge.net collaborative development platform, the > world's largest Open Source development site. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Amsn-commits mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/amsn-commits ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel