Tcl-pTk
view release on metacpan or search on metacpan
lib/Tcl/pTk/ttkTixNoteBook.pm view on Meta::CPAN
=item B<page_widget>
Implemented with the internal name-to-widget lookup hash.
=item B<raise>
Implemented with the ttkNotebook I<select> method.
=item B<raised>
Implemented with the ttkNotebook I<select> method.
=item B<geometryinfo>
Not implemented
=item B<identify>
Implemented with the ttkNotebook I<identify> tab method.
=item B<info("pages")>
Implemented with the ttkNotebook I<tab> method with a internal name-to-widget lookup hash.
=item B<info("focus")>
Implemented with the ttkNotebook I<select> method.
=item B<info("focusnext")>
Implemented with the ttkNotebook I<select> method and returns the next tab in the order.
=item B<info("focusnext")>
Implemented with the ttkNotebook I<select> method and returns the previous tab in the order.
=item B<info("active")>
Implemented with the ttkNotebook I<select> method.
=back
=cut
use Tcl::pTk qw(Ev);
use Carp;
use strict;
use base qw(Tcl::pTk::Frame);
Construct Tcl::pTk::Widget 'ttkTixNoteBook';
sub Populate {
my ($cw, $args) = @_;
# Set foreground and background options to undef, unless defined during widget creation
# This keeps Tcl::pTk::Derived from setting these options from the options database, which is
# not needed for ttk widgets, and also makes -state => 'disabled' not look right
foreach my $option( qw/ -foreground -background /){
$args->{$option} = undef unless( defined($args->{$option} ));
}
$cw->SUPER::Populate($args);
# Setup label options that will be ignored (setup to just be passive), because they don't
# exists in the substituted tile widget
my @ignoreOptions = ( qw/
-dynamicgeometry -backpagecolor -disabledforeground -focuscolor -font -inactivebackground -tabpadx -tabpady
/);
my %ignoreConfigSpecs = map( ($_ => [ "PASSIVE", $_, $_, undef ]), @ignoreOptions);
my $nb = $cw->ttkNotebook();
$nb->pack( -side => 'right', -fill => 'both', -expand => 1);
$cw->Advertise('ttkNotebook' => $nb);
# Create lookup of widget to tab name
$cw->{widgetLookup} = {};
$cw->Delegates(DEFAULT => $nb); # methods are handled by the combobox
$cw->ConfigSpecs(
DEFAULT => [ 'ttkNotebook' ], # Default options go to ttkCombobox
-ipadx => [ qw/METHOD ipadx ipadx/, undef ],
-ipady => [ qw/METHOD ipady ipady/, undef ],
%ignoreConfigSpecs,
);
}
#----------------------------------------------
# Sub called when -ipadx option changed
#
sub ipadx{
my ($cw, $ipadx) = @_;
if(! defined($ipadx)){ # Handle case where $widget->cget(-ipadx) is called
return $cw->{Configure}{-ipadx}
}
my $nb = $cw->Subwidget('ttkNotebook');
# Get current padding parms
my $padding = $nb->cget(-padding);
my ($left, $top) = (0,0);
($left, $top) = @$padding if( ref($padding) );
$nb->configure(-padding => [$ipadx, $top]);
}
#----------------------------------------------
# Sub called when -ipady option changed
#
sub ipady{
( run in 0.568 second using v1.01-cache-2.11-cpan-a1f116cd669 )