#!/usr/local/bin/perl
use Tk;
my $mw = new MainWindow; # Main Window
my $frm_name = $mw -> Frame();
my $lab = $frm_name -> Label(-text=>"Name:");
my $ent = $frm_name -> Entry(); ###输入文本框
my $but = $mw -> Button(-text=>"Push Me", -command =>\&push_button);
my $textarea = $mw -> Frame(); #Creating Another Frame
my $txt = $textarea -> Text(-width=>40, -height=>10);
my $srl_y = $textarea -> Scrollbar(-orient=>'v',-command=>[yview => $txt]);
my $srl_x = $textarea -> Scrollbar(-orient=>'h',-command=>[xview => $txt]);
$txt -> configure(-yscrollcommand=>['set', $srl_y],
-xscro
输入文本框模型
最新推荐文章于 2020-12-17 13:33:27 发布
这篇博客展示了如何使用Perl的Tk模块创建一个带有滚动条的输入文本框。当用户点击按钮后,输入的名字会被显示在文本框中。
摘要由CSDN通过智能技术生成