Um, so... which line is line #34 in your code?

(Since the <code> tag does not, by itself, number the lines, it will be helpful in your posting if you add a comment at the line that is referred to in a quoted error trace, to make that clear.)

Let me guess that it might be this line:

my $e1 = $p->add( 'Entry',
I'm guessing it's this one, because the error says you're trying to call an "add" method on a "Frame" widget, which has no such method; and while I have never used a NoteBook widget before, I wouldn't be surprised to look in its docs and discover that the widget you get back when you call the "add" method on a NoteBook is ... a Frame, which would make your "$p" a frame widget and raise the error. You should look that up.

As for buckaduck's reply, it is of course fine (and frequent practice) to both invoke and pack a widget at "the same time", as you do in your original code. Don't worry about that.


In reply to Re: Tk::NoteBook tabs in a Tk::Dialog question by graff
in thread Tk::NoteBook tabs in a Tk::Dialog question by rbc

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.