Basically all code is just a change of the elements defined in the Populate method.
$Gui::DlgProcessDelay::VERSION = 0.1; package Gui::DlgProcessDelay; use Tk::widgets qw/Label Button Entry/; use base qw/Gui::DlgBasic/; use strict; use warnings; use Carp qw/carp cluck/; use Data::Dumper; Construct Tk::Widget 'DlgProcessDelay'; # Initialising the object # sub ClassInit{ my ( $class, $mw ) = @_; $class->SUPER::ClassInit( $mw ); } # END: ClassInit # Populating the widget sub Populate{ my ( $self, $args ) = @_; $self->SUPER::Populate( $args ); $self->ConfigSpecs( -xlssource => [qw/METHOD xlssource XlsSource/], -xlstarget => [qw/METHOD xlstarget XlsTarget/], ); $self->{ _frmDelay } = $self->Frame( -label => "Delay Data" ) ->grid( -row => 0, -column => 0, -sticky => 'w' ); $self->{ _frmDelay }->Label( -text => "Delay Source:" ) ->grid( -row => 0, -column => 0, -sticky => 'w' ); $self->{ _frmDelay }->Label( -text => "Import Delay Data:" ) ->grid( -row => 0, -column => 1, -sticky => 'w' ); $self->{ _entDelayData } = $self->{ _frmDelay }->Entry( -textvariable => \$self->{ _sXlsSourc +e }, -borderwidth => 2, -width => 60, -relief => 'groove' ) ->grid( -row => 1, -column => 1, -columnspan => 3, -sticky => 'w' ); $self->{ _frmDelay }->Button( -text => "...", -command => sub { $self->_getXlsSource(); } ) ->grid( -row => 2, -column => 2, -sticky => 'w' ); $self->{ _frmDelay }->Button( -text => "Import File", -command => sub { $self->_importXlsFile(); } ) ->grid( -row => 2, -column => 3, -sticky => 'w' ); } # end Populate # Configure the delay import sourcefile name # sub xlssource{ my $self = shift; if ( @_ > 0 ) { my $file = shift; if ( -e $file ) { $self->{ _sXlsSource } = $file; } # END: if ( -e $file ) else { cluck "You tried to load a file non-existing file."; } # END: else ( -e $file ) } # END: if ( @_ > 0 ) else { # cluck "Monitored a cget on option -ciffile.\n"; return $self->{ _sXlsSource }; # cget( ) requests here } # END: else ( @_ > 0 } } # Configure the xls target name # sub xlstarget{ my $self = shift; if ( @_ > 0 ) { my $file = shift; $self->{ _sXlsTarget } = $file; } # END: if ( @_ > 0 ) else { # cluck "Monitored a cget on option -ciffile.\n"; return $self->{ _sXlsTarget }; # cget( ) requests here } # END: else ( @_ > 0 } } sub _getXlsSource{ my ( $self ) = @_; my $file = Gui::Misc::open_file( $self, "xls" ); $self->configure( -xlssource => $file ); } sub _importXlsSource{ print "Not yet implemented.\n"; } sub _getXlsTarget{ my ( $self ) = @_; my $file = Gui::Misc::save_file( $self, "xls" ); $self->configure( -xlstarget => $file ); } 1;
It seems to run fine through Populate. But hangs somewhere afterwards.

Cheers,
PerlingTheUK

In reply to Re^2: Custom TK Widget Endless Loop - but where? by PerlingTheUK
in thread Custom TK Widget Endless Loop - but where? by PerlingTheUK

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.