Use this binds to make your window drag upon any mouse click. Note: This example works on window with overrideredirect(1) (no Wm decoration). <anatoli \@ radulov.com>
$mw->bind('<ButtonPress-1>', sub{ my $xe = $mw->XEvent; $wdragiinfo{xoff} = $mw->pointerx - $mw->rootx; $wdragiinfo{yoff} = $mw->pointery - $mw->rooty; }); $mw->bind('<B1-Motion>', sub{ my ($x,$y); $x=$mw->pointerx-$wdragiinfo{xoff}; $y=$mw->pointery-$wdragiinfo{yoff}; $mw->geometry($mw->width."x".$mw->height."+$x+$y"); });

Replies are listed 'Best First'.
Re: Tk-Drag-Window
by avo (Pilgrim) on Oct 05, 2004 at 06:42 UTC
    Sorry guys, there is no need of this: my $xe = $mw->XEvent; :)
Re: Tk-Drag-Window
by zentara (Cardinal) on Oct 04, 2004 at 13:55 UTC
    Clever!!.

    I'm not really a human, but I play one on earth. flash japh