tkx

Do I always have to provide Tkx's -command argument an anonymous subroutine?

為{幸葍}努か 提交于 2020-03-16 07:27:07
问题 I find it a bit weird that I have to wrap defined subroutines anonymously when specifying the -command argument for Tkx widgets. An excerpt from a TkDocs tutorial demonstrates this: my $cb = $frm->new_ttk__button ( -text => "Calculate", -command => sub {calculate();} ); sub calculate { $meters = int(0.3048*$feet*10000.0+.5)/10000.0 || ''; } Why doesn't it work when I write -command => &calculate() or -command => \&calculate() ? 回答1: You don't have the syntax quite right. Your examples call

Should I use Perl/Tk, Tcl::Tk or Tkx for a Perl GUI?

拈花ヽ惹草 提交于 2019-12-05 11:27:36
问题 I really like Perl/Tk , but have come to the opinion that it's DOA. I think Tcl::Tk and Tkx are better solutions. Assume I drop Perl/Tk . Is the "most supported" route to go with Tcl::Tk (which hasn't been updated since 2007, and whose author seemingly cannot be reached), or Tkx ? Are either of these actively used/supported? 回答1: Under the hood both Tcl::Tk and Tkx use the Tcl module as a bridge to Tcl/Tk. The difference is in the API they present to Perl. Tkx was developed by ActiveState,

Perl Update UI on Long Thread

我的未来我决定 提交于 2019-12-04 04:28:26
问题 I have a Perl script running on version 5.10 build 1004 of ActiveStates Active Perl on windows xp which creates a UI and then runs a long process after a button press. During this process I would like to update the UI (a list box) with status on what is going on during the execution of this thread. Here is a stripped down version of the code. #!/usr/local/bin/perl use warnings; use strict; use Tkx; use threads; use threads::shared; my $outputText = " {a} {b}"; my $mw = Tkx::widget->new(".");

Should I use Perl/Tk, Tcl::Tk or Tkx for a Perl GUI?

半世苍凉 提交于 2019-12-04 00:33:54
I really like Perl/Tk , but have come to the opinion that it's DOA. I think Tcl::Tk and Tkx are better solutions. Assume I drop Perl/Tk . Is the "most supported" route to go with Tcl::Tk (which hasn't been updated since 2007, and whose author seemingly cannot be reached), or Tkx ? Are either of these actively used/supported? Under the hood both Tcl::Tk and Tkx use the Tcl module as a bridge to Tcl/Tk. The difference is in the API they present to Perl. Tkx was developed by ActiveState, who use it in the GUI for their tools. (e.g. PPM) It's actively used, though it's hard to say how widely. It's

Do I always have to provide Tkx's -command argument an anonymous subroutine?

时光怂恿深爱的人放手 提交于 2019-12-02 00:28:06
I find it a bit weird that I have to wrap defined subroutines anonymously when specifying the -command argument for Tkx widgets. An excerpt from a TkDocs tutorial demonstrates this: my $cb = $frm->new_ttk__button ( -text => "Calculate", -command => sub {calculate();} ); sub calculate { $meters = int(0.3048*$feet*10000.0+.5)/10000.0 || ''; } Why doesn't it work when I write -command => &calculate() or -command => \&calculate() ? You don't have the syntax quite right. Your examples call the subroutine (the & bypasses any prototypes) and passes either the return value ( &calculate() ) or a

Perl Update UI on Long Thread

北慕城南 提交于 2019-12-01 21:18:06
I have a Perl script running on version 5.10 build 1004 of ActiveStates Active Perl on windows xp which creates a UI and then runs a long process after a button press. During this process I would like to update the UI (a list box) with status on what is going on during the execution of this thread. Here is a stripped down version of the code. #!/usr/local/bin/perl use warnings; use strict; use Tkx; use threads; use threads::shared; my $outputText = " {a} {b}"; my $mw = Tkx::widget->new("."); $mw->g_wm_title("MD5 Checker"); $mw->g_wm_minsize(300,200); my $content = $mw->new_ttk__frame(-padding