I'm working with Tk again creating a GUI, and decided the Tk::NoteBook was what I needed. However, it's giving me some problems. For one, I get Tk::Button=Hash(hex#) is not a Tk Object ... and also, Tk::Error: Unkown tab "page0" (several times).

I get the latter one just by including an $notebook->add('something', options) statement (which the docs say is how you get a tab).

Here's the relavent portion, thanks for any help ...

my $nb = $mw->NoteBook->grid; for(0..$num-1) { my $page = $nb->add("Page$_", -text => "Name$_"); my $ne = $page->Entry( -textvariable => \$info->[$_]->{name}, ); my $ie = $page->Entry( -textvariable => \$info->[$_]->{index}, ); my $pom = $page->Optionmenu( -variable => \$info->[$_]->{parser}, -options => [@parsers], ); my $gom = $page->Optionmenu( -variable => \$info->[$_]->{graph}, -options => [@graphs], ); my $rcb = $page->Checkbutton( -text => 'Rare Event', -variable => \$info->[$_]->{rareevent}, ); my $dom = $page->Optionmenu( -variable => \$info->[$_]->{subdir}, -options => [@subdirs], ); my $fom = $page->Optionmenu( -variable => \$info->[$_]->{file}, -options => get_files($info->[$_]->{subdir}), ); my $b = $page->Button( -text => 'Set', -command => [\&record, {}], ); my @grid = (); if($name) { push @grid, \$ne} if($index) { push @grid, \$ie} if($parser) { push @grid, \$pom} if($graph) { push @grid, \$gom} if($rareevent) { push @grid, \$rcb} push @grid, (\$dom, \$fom, \$b); my $first = shift @grid; my $args = join(',', @grid); $$first->grid( eval $args );

In reply to Tk::Notebook 'unkown tab' by dimmesdale

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.