Config-Model-TkUI
view release on metacpan or search on metacpan
lib/Config/Model/Tk/AnyViewer.pm view on Meta::CPAN
-text => $help,
-justify => 'left',
-anchor => 'w',
-padx => $padx,
)->pack( -fill => 'x' );
}
return wantarray ? ( $help_frame, $widget ) : $help_frame;
}
sub update_help {
my ( $cw, $w, $help ) = @_;
# work around RT #67306
my $t = $cw->toplevel->cget('-title');
$w->text("\n\n=pod\n\n\n=encoding utf8\n\n$help\n\n=cut\n\n");
$w->toplevel->title($t);
}
sub add_summary {
my ( $cw, $elt_obj ) = @_;
lib/Config/Model/Tk/AnyViewer.pm view on Meta::CPAN
. ( $msg ? " with warnings" : '' ) );
$cw->Advertise( warn_widget => $warn_widget );
$cw->Advertise( warn_frame => $inner_frame );
$cw->update_warning($elt_obj);
return $frame;
}
sub update_warning {
my ( $cw, $elt_obj ) = @_;
my $wf = $cw->Subwidget('warn_frame');
my $ww = $cw->Subwidget('warn_widget');
my $fw = $cw->Subwidget('fix_widget');
$ww->delete( '0.0', 'end' );
$elt_obj->check;
my $err = $elt_obj->error_msg || '';
lib/Config/Model/Tk/HashEditor.pm view on Meta::CPAN
);
my $answer = $dialog->Show;
return unless $answer eq 'Yes';
$cw->{hash}->clear;
$cw->Subwidget('tklist')->delete( 0, 'end' );
$cw->reload_tree();
}
# update buttons state according to entry and list widget
# this method is called whenever one of them changes its content
sub update_state {
my ( $cw, %content ) = @_;
my $wat = \%widget_activation_table;
foreach my $button ( keys %$wat ) {
my $new = 1;
foreach my $c ( keys %content ) {
$new &&= $wat->{$button}{$c} || $content{$c};
}
my $subwidget = $cw->Subwidget($button) || next;
lib/Config/Model/TkUI.pm view on Meta::CPAN
$cw->{editor}->reload if defined $cw->{editor};
}
# call-back when Tree element is selected
sub on_browse {
my ( $cw, $path ) = @_;
$cw->update_loc_bar($path);
$cw->create_element_widget('view');
}
sub update_loc_bar {
my ( $cw, $path ) = @_;
#$cw->{path}=$path ;
my $datar = $cw->{tktree}->infoData($path);
my $obj = $datar->[1];
$cw->{location} = $obj->location_short;
}
sub on_select {
my ( $cw, $path ) = @_;
lib/Config/Model/TkUI.pm view on Meta::CPAN
$cw->setmode( 'hash', $newpath, $eltmode, $elt_loc, $opening, $actions, $scan_sub );
if ( $force_display_path and $force_display_path eq $elt_loc ) {
$cw->force_display($newpath, $elt_loc)
}
$prevpath = $newpath;
}
}
sub update_hash_image {
my ( $cw, $elt, $path ) = @_;
my $tkt = $cw->{tktree};
# check hash status and set warning image if necessary
my $img;
{
no warnings qw/uninitialized/;
$img = $warn_img if $elt->warning_msg;
}
( run in 1.234 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )