I have a Tk::NoteBook widget which I want to fill with graphs. Right now, I'd just like to place one graph per page. When I try to do this, the first page comes out fine, but on the subsequent pages, the graphs are squished up at the top. This code illustrates the problem. Is there a way around this? Thanks much.
use Tk; use Tk::Graph; use Tk::NoteBook; my $data = { Sleep => 51, Work => 135, Access => 124, mySQL => 5 }; my $to_register = { 'one' => [0,5,4,8,6,8], 'two' => [2,5,9,4,6,2], 'three' => [0,5,6,8,6,8], }; my $data1 = { 'one' => 3, 'two' => 3, 'three' => 3, }; $mw = MainWindow->new; my $nb = $mw->NoteBook(-ipadx => 10, -ipady => 10) ->pack(-side => 'top', -expand => '1', -fill => 'both'); ############# PAGE 1 ############# my $page1 = $nb->add("page1", -label => " test "); my $graph = $page1->Graph(-type => 'BARS')->pack(-expand => 1, -fill => 'both'); $graph->configure(-variable => $data); $graph->set($data); ############# PAGE 1 ############# my $page2 = $nb->add("page2", -label => " test1 "); my $graph1 = $page2->Graph(-type => 'Line', -max => 10, -look => 10)->pack(-expand => 1, -fill => 'both'); $graph1->register($to_register); $graph1->variable($data1); MainLoop;

In reply to Multiple Tk::Graphs with Tk::Notebook widget by mhearse

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.