Here is an example using plain Notebook tabs. I would guess that DynaTabFrame would work just as well as Notebook, just substitute it in.

The main problem with these widgets, is you need to pack them after all of them are constructed, so the window manager knows how much size to allocate, otherwise they get set to a small size, and get crushed. I used many scalars in this script, it probably should use a hash for storing refs... like $myhash{'frame1'}{'nb'}{'page5'}{etc}

#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::NoteBook; use Tk::Pane; use Tk::LabFrame; my $mw = new MainWindow; $mw->geometry("500x500"); my $pane = $mw->Scrolled('Pane', -scrollbars=>'osoe', sticky=>'nwse'); my $mf = $pane->Frame; my $nb = $mf->NoteBook(-width=>300); my $nb1 = $nb->add("page1", -label=>"Page 1"); my $nb2 = $nb->add("page2", -label=>"Page 2"); my $nb3 = $nb->add("page3", -label=>"Page 3"); my $nb4 = $nb->add("page4", -label=>"Page 4"); my $nbf1=$nb1->Scrolled('Text', -scrollbars=>'se')->pack; $nbf1->insert('end', "Tab 1"); my $nbf2=$nb2->Label(-text=>"Tab 2")->pack; my $nbf3=$nb3->LabFrame(-label=>"Tab 3", -labelside=>"acrosstop")->pac +k; my $nbf3b1=$nbf3->Radiobutton(-text=>"Radiobutton1")->pack(-anchor=>"n +w"); my $nbf3b2=$nbf3->Radiobutton(-text=>"Radiobutton2")->pack(-anchor=>"n +w"); my $nbf4=$nb4->Canvas(-background=>"yellow")->pack; $nbf4->createText(30,40, -text=>"Tab 4"); # second set my $mfz = $pane->Frame; my $nbz = $mfz->NoteBook(-width=>300); my $nb1z = $nbz->add("page1", -label=>"Page 1"); my $nb2z = $nbz->add("page2", -label=>"Page 2"); my $nb3z = $nbz->add("page3", -label=>"Page 3"); my $nb4z = $nbz->add("page4", -label=>"Page 4"); my $nbf1z=$nb1z->Scrolled('Text', -scrollbars=>'se')->pack; $nbf1z->insert('end', "Tab 1"); my $nbf2z=$nb2z->Label(-text=>"Tab 2")->pack; my $nbf3z=$nb3z->LabFrame(-label=>"Tab 3", -labelside=>"acrosstop")->p +ack; my $nbf3b1z=$nbf3z->Radiobutton(-text=>"Radiobutton1")->pack(-anchor=> +"nw"); my $nbf3b2z=$nbf3z->Radiobutton(-text=>"Radiobutton2")->pack(-anchor=> +"nw"); my $nbf4z=$nb4z->Canvas(-background=>"yellow")->pack; $nbf4z->createText(30,40, -text=>"Tab 4"); #pack them up $nb->pack; $mf->pack; $nbz->pack; $mfz->pack; $pane->pack(-expand=>1, -fill=>'both'); MainLoop;

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

In reply to Re: more than one DynaTabFrame by zentara
in thread more than one DynaTabFrame by liamlrb

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.