Tk::YANoteBook - Yet another NoteBook widget


 require Tk::YANoteBook;
 my $nb = $window->YANoteBook(@options)->pack;


A more flexible notebook widget. It does well in a multi document environment.

You can select any side where the tabs will be placed.

You can drag tabs with your mouse.

It has an overload if tabs won't fit any more.

You can specify a close button for a tab.


Switch: -autoupdate

Default value 1. The widget automatically updates the tab bar after a change is made. You can switch this off, make some massive changes, then change it back on to have only one update call.

Corresponds with the autoupdate method below.

Name: -backPageColor
Class: -BackPageColor
Switch: -backpagecolor

Background color for the tab frame.

Switch: -closeimage

Image for the close button on each tab. Default value is the close_icon.xpm in this distribution.

Switch: -closetabcall

Calback, called when you press the close button on a tab. By default it calls deletePage. If you replace it, you should call deletePage in your callback for the page to actually be removed.

Switch: -image

Image to be used for the more button. Default value none.

Switch: -onlyselect

Defaut value is 1. If cleared it will unselect a selected page when clicked, leaving no pages selected.

Switch: -selectoptions

Configuring the selected tab. Default value [ -relief => 'raised' ].

Switch: -selecttabcall

Calback, called when a tab is selected.

Switch: -rigid

Default is 1. When cleared the widget will resize to minium when no page is selected.

Switch: -tabside

Default value 'top'. Only available at create time. Can be top, left, bottom or right.

Switch: -text

Text for the more button. Default value 'More'.

Switch: -unselectoptions

Configuring the unselected tab. Default value [ -relief => 'flat'].

Switch: -unselecttabcall

Calback, called when a tab is unselected.


addPage($name, @options)

Adds a tab. You can specify following options:


    Default is 0. If set a close button will be added to the tab.


    Text on the tab. If not set, it will be equal to $name.


    Display an image instead of a text.


Sets and returns the autoupdate flag. See the -autoupdate option.


Deletes $name. -closetabcall will be called in advance. That call should return 1 for the tab to be closed.


Returns the page frame object for $name.


Returns the tab object for $name.


Returns true if $name is currently on display


Returns the name of the last displayed tab.


Returns the number of pages


Returns true if $name exists

renamePage($old, $new)

Rename a page.


Select page $name.

If $name is not displayed it is moved to the front of the displayed items.


Returns a sorted list of all page names.


Returns the position on the tab frame of $name. Returns undef for undisplayed pages.


Same as Perl.


Hans Jeuken (hanje at cpan dot org)


Unknown. If you find any, please contact the author.