The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Tk::YANoteBook - Yet another NoteBook widget

SYNOPSIS

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

DESCRIPTION

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.

CONFIG VARIABLES

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.

METHODS

addPage($name, @options)

Adds a tab. You can specify following options:

    -closebutton

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

    -title

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

    -titleimg

    Display an image instead of a text.

autoupdate(?$boolean?)

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

deletePage($name)

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

getPage($name)

Returns the page frame object for $name.

getTab($name)

Returns the tab object for $name.

isDisplayed($name)

Returns true if $name is currently on display

lastDisplayed

Returns the name of the last displayed tab.

pageCount

Returns the number of pages

pageExists($name)

Returns true if $name exists

renamePage($old, $new)

Rename a page.

selectPage($name)

Select page $name.

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

tabList

Returns a sorted list of all page names.

tabPosition($name)

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

LICENSE

Same as Perl.

AUTHOR

Hans Jeuken (hanje at cpan dot org)

BUGS

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