All is well except that what I'd like is that when a user resizes the window, the graph displayed should be "layedout" again so that it adjusts to the size of the window. I first tried to bind the '<Configure>' event to the canvas this way:my $gv = $root->Scrolled('GraphViz', -background => '#B0C0FF', -scrollbars=>'se', ) ->pack (-side=>'top',-expand =>1, -fill=>'both');
But nothing happens! I the binding is not used and the Subwidget returns an undefined "$canvas". So I modified the above code to bind the root window with Configure as in:my $canvas = $gv->Subwidget("canvas'); $canvas->bind('<Configure>', sub { my $w = shift; print $w->Width . " and " . $w->Heig +ht . "\n"; &redo_layout(); };
This works! But the behavior is not great. The graph layout does adjust but is a very "flickery" way. And strangely, window resize prints a lot of values for width and height when the bound subroutine is called. What can I do to make this a nice user experience? Why can't I bind '<Configure>' to the subwidget "canvas'? Thank you in advance.$root->bind('<Configure>', sub { my $w = shift; print $w->Width . " and " . $w->Heig +ht . "\n"; &redo_layout(); };
In reply to perl tk graphviz by dlal66
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |