Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to attach one window to another?

1 view
Skip to first unread message

Daniel Kramer

unread,
Nov 5, 1999, 3:00:00 AM11/5/99
to
I have a procedure called "sticky_win" that butts one of my tk windows
up against the boarder of another window. It works fine using the wm
geometry command. I want this command to be called every time the
"master" window moves or resized.. so the "child" win will always stick
right to its side. The problem is there is no bind I can find to detect
if the user has moved the window.

Here is my proc:

proc {sticky_win} {} {
global widget

set borderx 23
set bordery 32

set masterx [lindex [split [wm geometry .top31] "x"] 0]
set xoffset [lindex [split [wm geometry .top31] "+"] 1]

set locationx [expr $masterx + $xoffset + $borderx]
set locationy [expr [lindex [split [wm geometry .top31] "+"] 2] +
$bordery]

set childlocation [split [wm geometry $widget(chanque)] "+"]

set newque "[lindex $childlocation 0]+$locationx+$locationy"

wm geometry $widget(chanque) $newque
}

the proc works fine.. I bind the parent window .top31.. i have tried
<Leave>, <Enter> <ButtonRelease-1>..

some of them work once I move my mouse off of the top wm boarder an into
the widget.. but I can't get it to call the proc right after stamping
down the new window location.

Is there any way to detect this?

Thanks,

Daniel

--
-----------------------------------------------------------------------------
Daniel Kramer
http://www.visionart.com/~daniel/
dan...@visionart.com: VisionArt Design and Animation


0 new messages