Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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.

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2022-01-20 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (56 votes). Check out past polls.

    Notices?