Tk-Dressing
view release on metacpan or search on metacpan
lib/Tk/Dressing.pm view on Meta::CPAN
$this->design_widget( -widget => $widget, -clear => 1 );
$current_theme = undef;
}
return 1;
}
sub _default_config {
my ( $this, $widget, $ref_config_theme ) = @_;
my ( $class, $type ) = split m/::/msx, ref $widget;
$type = defined $type ? $type : $class;
if ( not defined $type ) { return; }
# Store the initial configuration before set the first theme
if ( !$initial_theme{$type} ) {
foreach my $option ( sort keys %{ $ref_config_theme->{$type} } ) {
my $initial_value = $widget->cget($option);
next if ( not defined $initial_value );
if ( $initial_value eq 'SystemButtonFace' and $type eq 'Entry' ) {
lib/Tk/Dressing.pm view on Meta::CPAN
$ref_config_theme = $new_theme{$theme};
}
if ( not defined $ref_config_theme ) { return; }
# Get Default configuration
if ( ( !%initial_theme ) or ( not defined $clear or $clear != 1 ) ) {
$this->_default_config( $widget, $ref_config_theme );
}
# Get Class an type of widget to design it
my ( $class, $type ) = split m/::/msx, ref $widget;
# For MainWindows widget, ref($widget) = MainWindow, then $type = $class
# Else for Tk::Widget, ref($widget) = Tk::Toplevel or Tk::Frame, etc => $type ok
$type = defined $type ? $type : $class;
if ( not defined $type ) { return; }
# Read configuration option
if ( my $design_type = $ref_config_theme->{$type} ) {
# Set configuration
( run in 1.364 second using v1.01-cache-2.11-cpan-71847e10f99 )