是否有类似 PySimpleGUI for Perl 的工具?

Is there a tool like PySimpleGUI for Perl?

我正在寻找与 PySimpleGUI 一样简单的 Perl GUI 工具。 PySimpleGUI 声称是处理此类事情的不错选择:

这些是我的要求,因为 PySimpleGUI 提供了所有这些,我尝试了一个项目。我喜欢它。这提示尝试为 Perl.

找到类似的东西

我在 Linux 上使用 KDE 运行宁 perl 5,版本 30。

到目前为止我只找到:

我无法将示例获取到 运行,并且提供的文档不符合我的要求。 (我会在一个单独的问题中询问我使用 GUIDeFATE 的具体问题,但 GUIDeFATE 并没有像 PySimpleGUI 那样积极开发。)

我过去曾将 Kdialog 用于 bash 脚本,但这不是我想要的。

是否有适用于 Perl 的 PySimpleGUI 的等价物?

我在 Perl 中找不到类似 PySimpleGUI 的东西。我认为您需要基于工具包的完整 api 构建 gui(而不是像 PySimpleGUI 这样的 api 的简化版本)。我知道 Gtk3Tk toolkits are actively used. There are also the Wx and QtCore4 工具包,但在我看来,这些工具包使用较少,也没有积极维护。

下面是 Gtk3 中的示例:

use feature qw(say);
use strict;
use warnings;
use Gtk3 -init;

my $window = Gtk3::Window->new( 'toplevel' );
$window->signal_connect( destroy  => sub { Gtk3->main_quit() } );
my $grid = Gtk3::Grid->new();
$window->add( $grid );
my $label1 = Gtk3::Label->new('Some text on Row 1');
$grid->attach($label1, 0,0,1,1);
my $label2 = Gtk3::Label->new('Enter something on Row 2');
$grid->attach($label2, 0,1,1,1);
my $entry = Gtk3::Entry->new();
$grid->attach($entry, 1,1,1,1);
my $button1 = Gtk3::Button->new('Ok');
$button1->signal_connect('clicked' => sub { say "You entered ", $entry->get_text( ) } );
$grid->attach($button1, 0,2,1,1);
my $button2 = Gtk3::Button->new('Cancel');
$button2->signal_connect('clicked' => sub { $window->destroy() } );
$grid->attach($button2, 1,2,1,1);
$window->set_position('center_always');
$window->show_all();
Gtk3->main();

这是 Håkon 使用 Tk

的示例
use feature qw(say);
use strict;
use warnings;
use Tk;
my $text= '';
my $window = tkinit();
$window->Label(-text =>'Some text on Row 1')->grid();
$window->Label(-text=>'Enter something on Row 2',
           )->grid(
    $window->Entry(-textvariable=> $text)
);
$window->Button(-text=>'Ok',
                -command=>sub{say "You entered $text"},
            )->grid(
    $window->Button(-text=>'Cancel',-command=>sub{Tk::exit})
);
$window->withdraw;
$window->Popup;
MainLoop;