I'm stumped, need help 
Author Message
 I'm stumped, need help

I've searched all my books and cannot find out how to
detect when the user has moved one of my toplevel windows.

I want to then find out where it moved to and move another
window next to it. Sort of like having an optional docking
windows mode where they all move together or separately at
the users option (by a prefs setting).

any help on how to do this would be most appreciated

thanks
eric



Mon, 24 Jun 2002 03:00:00 GMT  
 I'm stumped, need help

Quote:

> I've searched all my books and cannot find out how to
> detect when the user has moved one of my toplevel windows.

> I want to then find out where it moved to and move another
> window next to it. Sort of like having an optional docking
> windows mode where they all move together or separately at
> the users option (by a prefs setting).

> any help on how to do this would be most appreciated

Try

    proc trackPosition { w } {
        puts stderr "$w:[wm geometry $w]"
    }
    bind $w <Configure> [list trackPosition %W]

(I tried passing %X and %Y to the binding but at least on W98, they were always
0.)

                                             Chris
--
Christopher Nelson, Sr. Software Engineer         Pinebush Technologies, Inc.
Author: Tcl/Tk Programmer's Reference    http://www.purl.org/net/TclTkProgRef



Mon, 24 Jun 2002 03:00:00 GMT  
 I'm stumped, need help

Quote:

> I've searched all my books and cannot find out how to
> detect when the user has moved one of my toplevel windows.

Bind to the <Configure> event.  Watch out on Windows - if you
have opaque dragging, it will get triggered at each refresh
while moving the window.

--
   Jeffrey Hobbs                          The Tcl Guy
   jeffrey.hobbs at scriptics.com         Scriptics Corp.



Mon, 24 Jun 2002 03:00:00 GMT  
 I'm stumped, need help
Thanks very much, that did it for me!

(Love your reference book!)

eric

Quote:

> Try

>     proc trackPosition { w } {
>         puts stderr "$w:[wm geometry $w]"
>     }
>     bind $w <Configure> [list trackPosition %W]

> (I tried passing %X and %Y to the binding but at least on W98, they were always
> 0.)

>                                              Chris
> --
> Christopher Nelson, Sr. Software Engineer         Pinebush Technologies, Inc.
> Author: Tcl/Tk Programmer's Reference    http://www.purl.org/net/TclTkProgRef



Tue, 25 Jun 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. An AWK poser that's stumped a novice

2. Okay, I'm stumped.

3. error 19 - i'm stumped - snip [1/1]

4. I'm Stumped ...

5. I'm stumped on threads

6. Problems installing pythonwin - I'm stumped

7. [Fwd: Re: I'm stumped on threads]

8. proc global problem - I'm completely stumped

9. expect u question - i'm stumped - completely...

10. yes i'm stumped

11. Stumped - please help - subject is authenticating users with sessions

12. Need Help With 'BY'

 

 
Powered by phpBB® Forum Software