I would start with

See Re^3: resizing problem with Tk appl using PackForget, Tk::Scrolled, (inside Tk::Wm sub Scrolled), inside Tk::Frame sub packscrollbars, Tk::WidgetDump, and start with

#!/usr/bin/perl -- #~ #~ perltidy -olq -csc -csci=3 -cscl="sub : BEGIN END " -otr -opr -ce + -nibc -i=4 -pt=0 "-nsak=*" #!/usr/bin/perl -- use strict; use warnings; use Tk qw/ tkinit /; Main( @ARGV ); exit( 0 ); sub Main { my $mw = TkMain( @_ ); $mw->WidgetDump; ## use Tk::WidgetDump; $mw->MainLoop; } ## end sub Main sub TkMain { my $mw = tkinit( -bg => 'green', ); $mw->minsize( 60, 60 ); my $top = $mw->Pane( -bg => 'orange', )->pack( -side => 'top', -expand => 0, -fill => 'x', ); my $label = $top->Label( -text => 'Label', -bg => 'pink', )->pack( qw/ -side left / ); my $cans = $mw->Scrolled( Frame => -bg => 'white', )->pack( -fill => 'both', -expand => 1, ); my $can = $cans->Canvas( -width => 300, -height => 300, -bg => 'pink', )->pack( -fill => 'none', -expand => 0, ); $top->Button( -text => 'packscrollbars', -command => [ \&unforgetScrollbars, $cans ], )->pack( qw/ -side left / ); $top->Button( -text => 'packForget scrollbars', -command => [ \&forgetSrollbars, $cans ], )->pack( qw/ -side left / ); #~ $mw->bind( '<Configure>' => [ \&gotResized , $cans ] ) ; ## too + much $mw->bind( $cans, '<Configure>' => \&gotResized ); ## *ok* ## http://www.tcl.tk/man/tcl8.4/TkCmd/bind.htm $cans->Subwidget( 'xscrollbar' )->bind( '<Configure>', \&gotResize +d ) ; ## bingo? ## $xscrollbar->parent->.... return $mw; } ## end sub TkMain sub gotResized { warn "@_"; my( $cans ) = @_; } ## end sub gotResized sub unforgetScrollbars { my( $cans ) = @_; $cans->Subwidget( 'ysbslice' )->pack; $cans->Subwidget( 'corner' )->pack; $cans->Subwidget( 'yscrollbar' )->pack; $cans->Subwidget( 'xscrollbar' )->pack; $cans->packscrollbars; } ## end sub unforgetScrollbars sub forgetSrollbars { my( $cans ) = @_; $cans->Subwidget( 'ysbslice' )->packForget; #~ $cans->Subwidget( 'corner' )->packForget; $cans->Subwidget( 'yscrollbar' )->packForget; $cans->Subwidget( 'xscrollbar' )->packForget; } ## end sub forgetSrollbars __END__

In reply to Re: TK Geometry question. by Anonymous Monk
in thread TK Geometry question. by kb3ien

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.