The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

LibUI::Tab - Multi-Page Control Interface that Displays One Page at a Time

SYNOPSIS

    use LibUI ':all';
    use LibUI::Tab;
    use LibUI::Window;
    use LibUI::Label;
    Init( { Size => 1024 } ) && die;
    my $window = LibUI::Window->new( 'Hi', 320, 100, 0 );
    my $tabs   = LibUI::Tab->new;
    $tabs->append( $_, LibUI::Label->new($_) ) for qw[First Second Third Fourth];
    $tabs->setMargined( $_ - 1, 1 ) for 1 .. $tabs->numPages;
    $window->setChild($tabs);
    $window->onClosing(
        sub {
            Quit();
            return 1;
        },
        undef
    );
    $window->show;
    Main();

DESCRIPTION

A LibUI::Tab object represents a control interface that displays one page at a time.

Each page/tab has an associated label that can be selected to switch between pages/tabs.

Functions

Not a lot here but... well, it's just a tab box.

new( ... )

    my $tab = LibUI::Tab->new( );

Creates a new LibUI::Tab.

append( ... )

    $tab->append( 'Welcome', $box );

Appends a control in form of a page/tab with label.

Expected parameters include:

$text - label text
$child - LibUI::Control instance to append

delete( ... )

    $tab->delete( $index );

Removes the control at $index.

Note: The control is neither destroyed nor freed.

insertAt( ... )

    $tab->insertAt( 'Settings', 5, $box );

Inserts a control in form of a page/tab with label at $index.

Expected parameters include:

$text - label text
$index - index at which to insert the control
$child - LibUI::Control instance to append

numPages( )

    my $tally = $tab->numPages( );

Returns the number of pages contained.

margined( )

    if( $tab->margined( 1 ) ) {
        ...;
    }

Returns whether or not the page/tab at $index has a margin.

setMargined( ... )

    $tab->setMargined( 1, 1 );

Sets whether or not the page/tab at index has a margin.

The margin size is determined by the OS defaults.

Expected parameters include:

$index - index at which to query the control
$margin - boolean value

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Sanko Robinson <sanko@cpan.org>