Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
有类似PySimpleGUI的Perl工具吗?_Perl_User Interface_Sh - Fatal编程技术网

有类似PySimpleGUI的Perl工具吗?

有类似PySimpleGUI的Perl工具吗?,perl,user-interface,sh,Perl,User Interface,Sh,我正在寻找一个Perl GUI工具,它与。PySimpleGUI声称对于以下内容是一个不错的选择: 将简单GUI的便利性添加到CLI Perl脚本中 分享我在终端上运行的一些很酷的Perl工具,但为(内部)用户提供一个简单的GUI 与朋友或家人共享我的Perl程序(他们对CLI不太熟悉) 在系统托盘中运行程序(可能) 正在寻找一个“受支持”且不断开发和改进的GUI包 良好的文档和示例 这些是我的需求,因为PySimpleGUI提供了所有这些,所以我尝试了一个项目。我喜欢它。这促使我们尝试为P

我正在寻找一个Perl GUI工具,它与。PySimpleGUI声称对于以下内容是一个不错的选择:

  • 将简单GUI的便利性添加到CLI Perl脚本中
  • 分享我在终端上运行的一些很酷的Perl工具,但为(内部)用户提供一个简单的GUI
  • 与朋友或家人共享我的Perl程序(他们对CLI不太熟悉)
  • 在系统托盘中运行程序(可能)
  • 正在寻找一个“受支持”且不断开发和改进的GUI包
  • 良好的文档和示例
这些是我的需求,因为PySimpleGUI提供了所有这些,所以我尝试了一个项目。我喜欢它。这促使我们尝试为Perl找到类似的东西

我正在使用KDE在Linux上运行Perl5,版本30

到目前为止,我只发现:

  • saiftynet/GUIDeFATE:来自文本编辑器的GUI设计
我无法运行示例,并且提供的文档不符合我的要求。(我将在另一个问题中询问GUIDeFATE的具体问题,但GUIDeFATE没有像PySimpleGUI那样积极开发。)

我在过去使用过bash脚本,但这不是我想要的


在Perl中是否有PySimpleGUI的等价物?我在Perl中找不到类似于
PySimpleGUI的东西。我认为您需要基于工具包的完整api构建gui(而不是像
PySimpleGUI
这样的简化版api)。我知道 并积极使用工具包。还有一些工具和工具包,但我认为它们使用较少,也没有积极维护

以下是
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使用

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;