#!/usr/local/bin/perl -w use Tk; use strict; require Tk::TFrame; require Tk::Adjuster; my ( $mw, $frmLeft, $adjMiddle, $frmRight, ); $mw = MainWindow->new( -title => 'foo' ); $frmLeft = $mw->TFrame( label => [ -text => 'links' ] )->pack( -expand => 1, -fill => "both", -side => 'left' ); $adjMiddle = $mw->Adjuster( -widget => $frmLeft, -side => 'left', -restore => 1, )->pack( -side => 'left', -fill => 'y' ); $frmRight = $mw->TFrame( label => [ -text => 'rechts' ] )->pack( -expand => 1, -fill => "both", -side => 'right' ); ###### Added bit ################################### $mw->update; my ( $mw_width, $ratio ); $mw->bind( $mw, '' => sub { undef $ratio } ); $mw->bind( $mw, '' => sub { $mw->XEvent; my $width = $mw->width; $mw_width = $width unless $mw_width; if ( $width != $mw_width ) { $ratio = ( $frmLeft->cget( -borderwidth ) + $frmLeft->width + $adjMiddle->width / 2 ) / $mw_width unless $ratio; $frmLeft->configure( -width => int( $width * $ratio ) ); $mw_width = $width; } } ); $mw->eventGenerate(''); ####################################################### MainLoop;