LibUI::Tab - Multi-Page Control Interface that Displays One Page at a Time
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();
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.
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
$child
delete( ... )
$tab->delete( $index );
Removes the control at $index.
$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.
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.
$margin
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Sanko Robinson <sanko@cpan.org>
To install LibUI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LibUI
CPAN shell
perl -MCPAN -e shell install LibUI
For more information on module installation, please visit the detailed CPAN module installation guide.