in reply to Multiple rows of notebook tabs in Tk

From Mastering Perl/Tk by Steve Lidie & Nancy Walsh published by O'Reilly.

"NoteBook Limitations - pg 580 - You can't have the tabs for a NoteBook automatically wrap around and make more than one line of tabs. Consequently, you might make so many tabs that your window will be too big to be displayed properly. In that case, you might consider having a page contain another NoteBook widget, which will essentially give you two rows of tabs."

This would imply that you can use multiple NoteBook widgets on a page. So a quick test.

use strict; use Tk; use Tk::NoteBook; my $MainWindow = MainWindow->new(-title => 'Testing Notebook Widgets') +; my $FirstNoteBook = $MainWindow->NoteBook()->pack(-expand => 1, -fill= +>'both'); my $SecondNoteBook = $MainWindow->NoteBook()->pack(-expand => 1, -fill + => 'both'); my $PageOne = $FirstNoteBook->add('page1', -label=> 'NB 1 Page 1'); my $PageTwo = $FirstNoteBook->add('page2', -label=> 'NB 1 Page 2'); my $PageThree = $SecondNoteBook->add('page3', -label=> 'NB 2 Page 1'); my $PageFour = $SecondNoteBook->add('page4', -label=> 'NB 2 Page 2'); MainLoop;

This fired up fine with four tabs and blank pages. Now there may be some considerations depending on how you want the output of each page displayed.


"No matter where you go, there you are." BB

Replies are listed 'Best First'.
Re^2: Multiple rows of notebook tabs in Tk
by biochris (Beadle) on Mar 14, 2005 at 16:49 UTC
    Thanks for the snipet. biochris

      It was there to show that you can have multipe notebook widgets on one main window, you would need to keep track of what you would call front row and back row and dynamically update the title of the pages to have this work like a multi row notebook page. Not too terribly hard but not efficient. I agree with most said about trying to visualise the data differently if you find space issues with this particular widget.

      "No matter where you go, there you are." BB