我想为我的Perl程序创建一个简单的
Windows GUI.它基本上需要生成一个窗口,将日志信息写入文本框,并有一个输入框和几个开始/停止按钮.
有没有人有关于我使用哪个Perl模块的提示?像Qt一样工作的人,这可能是一种偏好,但我并不感到困扰.
解决方法
对于这样一个简单的项目,我确实使用过
Win32::GUI次.主窗口有一个菜单,一个文本框和几个按钮和复选框.有效.
摘自设置GUI的方法(只是为了给你一个想法):
my @menu_items = ( '&File' => 'File',' > &Open' => { -name => 'FileOpen',-onClick => sub { $self->onFileOpen(@_) },},' > &Close' => { -name => 'FileClose',-onClick => sub { $self->onFileClose(@_) },' > E&xit' => { -name => 'FileExit',-onClick => sub { $self->onFileExit(@_) },'&Help' => 'Help',' > &About' => { -name => 'About',-onClick => sub { $self->onHelpAbout(@_) },); $self->set_main_menu( Win32::GUI::MakeMenu(@menu_items) ); my $window = $self->set_main_window( Win32::GUI::Window->new( -menu => $self->get_main_menu,-name => 'Main',-sizable => 0,-resizable => 0,-hasmaximize => 0,-maximizeBox => 0,-title => $self->get_program_name,-onTerminate => sub { -1 },-onTimer => sub { $self->onTimer(@_) },),); $self->set_log_field( $window->AddTextfield( -name => 'Log',-font => Win32::GUI::Font->new( -name => 'LogFont',-face => 'Courier New',-size => 9,-multiline => 1,-wantreturn => 1,-autovscroll => 1,-vscroll => 1,-readonly => 1,); $self->get_log_field->MaxLength(40000); $self->set_status_bar( $window->AddStatusBar( -name => 'Status',-text => $self->get_program_name,);