I'm not sure what your problem is, but the "flicker" may be caused by Graphviz trying to rebuild it's graphics and display it at each Configure event. As you already see, the Configure event fires many times while resizing. You may be able to work out a flag, where a flag is set when the mouse button 1 is pressed, and set back to zero when the button 1 is released. Then in your Configure binding, you can return if the flag is set, thus only having Graphviz rebuild at the end of the resize. See Re: perltk autoresize following users resize for a similar hack using Enter and Leave bindings.

You might also look at the Tk::Panedwindow widget. It's perldoc says

RESIZING PANES A pane is resized by grabbing the sash (or sash handle if present) and + dragging with the mouse. This is accomplished via mouse motion bindings on the + widget. When a sash is moved, the sizes of the panes on each side o +f the sash, and thus the widgets in thosepanes, are adjusted. When a pane is resized from outside (eg, it is packed to expand and fi +ll, and the containing toplevel is resized), space is added to the fi +nal (rightmost or bottommost) pane in the window.
An example:
#!/usr/bin/perl -w use strict; use Tk; my @scrollregion = (0,0,500,500); my $mw=tkinit; my $windowpane = $mw->Panedwindow( -orient => 'vertical' ) ->pack( -side => 'top' , -expand => 1, -fill => 'both' ); my $firstframe=$mw->Frame(); my $secondframe=$mw->Frame(); my $cf=$firstframe->Scrolled( 'Canvas', -bg=>'red', -scrollregion=>\@scrollregion, -confine=>1, -scrollbars=>'se') ->pack(-expand=>1, -fill=>'both', -anchor=>'nw'); $cf->create('rectangle',0,0,500,500); my $statusbar = $firstframe->Label( -text=>"This is a statusbar") ->pack(-fill=>'x', -expand=>0); my $tw = $secondframe->Scrolled( 'Text', -scrollbars=>'osoe') ->pack(-fill=>'both', -expand=>1, -anchor=>'nw'); $windowpane->add($firstframe, -sticky=>'nsew'); $windowpane->add($secondframe, -sticky=>'nsew'); $windowpane->bind( '<Configure>' => \&OnResize ); $mw->bind( '<Configure>' => \&OnResize ); MainLoop; sub OnResize{ my ($newx,$newy) = ($mw->width, $mw->height); $cf->configure( -scrollregion=>[0,0,$newx,$newy]); } #########################################################

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

In reply to Re: perl tk graphviz by zentara
in thread perl tk graphviz by dlal66

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.