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)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk vs Tcl::pTk speed image
by Anonymous Monk on Apr 06, 2018 at 07:38 UTC | |
by Anonymous Monk on Apr 06, 2018 at 10:22 UTC | |
by Anonymous Monk on Apr 06, 2018 at 11:54 UTC | |
by Anonymous Monk on Apr 06, 2018 at 11:11 UTC | |
by Anonymous Monk on Apr 06, 2018 at 11:49 UTC | |
Re: Tk vs Tcl::pTk speed image
by Anonymous Monk on May 17, 2018 at 17:24 UTC | |
by Anonymous Monk on May 18, 2018 at 02:39 UTC | |
by Anonymous Monk on May 18, 2018 at 05:58 UTC | |
by Anonymous Monk on May 18, 2018 at 22:10 UTC |