Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Tk::NoteBook tabs in a Tk::Dialog question

by buckaduck (Chaplain)
on Apr 23, 2002 at 20:27 UTC ( #161426=note: print w/replies, xml ) Need Help??

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.


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

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://161426]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2023-12-11 02:46 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (41 votes). Check out past polls.