http://www.perlmonks.org?node_id=1212398

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

I am trying to adapt my Tk program using Tcl::pTk which I find a very interesting module to revamp the use of Tk in Perl (modern interface, etc.). I could port most of my old UI and it works fine. What I am struggling with are speed issues with my icons. In standard Tk everything is quick, loading the same set of icons (png) with Tcl::pTk takes ages. As both module should be a layer on Tk, I do not quite understand the big difference (10x time in pTk). You can almost take a coffee in the time the GUI is ready.

My exosystem: Windows 10 and Activeperl 5.16 (I wasn't able to make Tcl::pTk work with Strawberryperl....).

Here a small script to make the point

use Tcl::pTk; #use Tk;#using this instead of Tcl::pTk it is 10x/20x quicker #use Tk::PNG; my $mw = MainWindow->new(); my $lab = $mw->Label(-text => "Hello world")->pack; foreach (1..30){ my $PngSettings = $mw->Photo( -file => "settings.png"); $mw->Button(-image => $PngSettings, -command => sub { $lab->configure(-text=>"[". $lab->cget('-text')."]"); }, -borderwidth => '0', )->pack(-side=>'right', -anchor => 'e', -padx=>5, -pady=>5); } MainLoop;

Am I missing something? It is a shame that it seems practically nobody is using this module as there is almost nothing out there about Tcl::pTk (besides the good POD)