in reply to Tk::NoteBook tabs in a Tk::Dialog question

I think that your code:
my $d = $dd->Frame()->pack(); my $n = $d->NoteBook()->pack( -expand => 0, -fill => 'x' );
should probably be something more like (untested):
my $d = $dd->add(Tk::Frame); $d->pack; my $n = $d->add(Tk::NoteBook); $n->pack( -expand => 0, -fill => 'x' );
The Tk widgets are not method names, you have to pass the widget names to the add() method. Also, I believe that you should assign the widget to a variable first and then pack() it.

buckaduck

Replies are listed 'Best First'.
Re^2: Tk::NoteBook tabs in a Tk::Dialog question
by HeatSeekerCannibal (Beadle) on Nov 10, 2006 at 22:28 UTC
    Buckaduck.... ....i dont know if its worth mentioning it, because his code doesnt have the same error, however it does have the same symptom as mine.... It CAN work like this:
    use Tk; use Tk::NoteBook; my $mw = MainWindow->new(-width => 40, -height => 50); $mw->title("Ventana Principal"); $mw->Label(-text => "Uso de pack")->pack; $FrameFon = $mw->Frame(-relief => 'raised')->pack(-side => 'bottom', f +ill => 'x', -expand => 1); $Libreta = $FrameFon->NoteBook(); $Libreta->pack(-side => 'top'); $Libreta->add("Pagina1", -label =>"Configuracion"); $Libreta->add("Pagina2", -label => "Logs"); MainLoop;
    ...but mine didnt work because i was writing Notebook instead of NoteBook.... :">
    Heatseeker Cannibal