ActiveState से Perl 5.10 पूर्व संकलित आ Tkx जो एक गुई मंच है साथ। यदि आप अधिक वेब उदाहरण वाले मॉड्यूल चाहते हैं तो आप पर्ल Tk डाउनलोड कर सकते हैं। जो भी मॉड्यूल आप उपयोग करते हैं, आप Sourceforge से GUIbuilder डाउनलोड कर सकते हैं और यह पर्ल के लिए बहुत अच्छा टैक्स या टैक्स कोड लिखता है, और पायथन, रूबी के लिए कोड कोड।
इस कोड को काफी हद तक उत्पादन कोड का एक उदाहरण के रूप में GuiBuilder द्वारा उत्पन्न की गई:
use Tkx;
Tkx::package_require('BWidget');
sub example::ui {
my($root) = @_;
my($_entry_box) = $root->new_entry(
-width => 0,
);
my($_text_box) = $root->new_text(
-height => 0,
-width => 0,
);
my($_label) = $root->new_label(
-text => "Hello World",
);
my($_textbox_horiz_scrollbar) = $root->new_scrollbar(
-orient => "horizontal",
);
my($_textbox_vert_scrollbar) = $root->new_scrollbar(
);
my($_Start_Button) = $root->new_Button(
-text => "Start",
-width => 10,
);
my($_Stop_Button) = $root->new_Button(
-text => "Stop",
-width => 10,
);
$_entry_box->configure(
-invalidcommand => \&_entry_box_invalidcommand
);
$_entry_box->configure(
-validatecommand => \&_entry_box_validatecommand
);
$_entry_box->configure(
-xscrollcommand => \&_entry_box_xscrollcommand
);
$_text_box->configure(
-xscrollcommand => [ $_textbox_horiz_scrollbar => set ]
);
$_text_box->configure(
-yscrollcommand => [ $_textbox_vert_scrollbar => set ]
);
$_textbox_horiz_scrollbar->configure(
-command => [ $_text_box => xview ]
);
$_textbox_vert_scrollbar->configure(
-command => [ $_text_box => yview ]
);
$_Start_Button->configure(
-armcommand => \&_Start_Button_armcommand
);
$_Start_Button->configure(
-command => \&_Start_Button_command
);
$_Start_Button->configure(
-disarmcommand => \&_Start_Button_disarmcommand
);
$_Stop_Button->configure(
-armcommand => \&_Stop_Button_armcommand
);
$_Stop_Button->configure(
-command => \&_Stop_Button_command
);
$_Stop_Button->configure(
-disarmcommand => \&_Stop_Button_disarmcommand
);
sub _entry_box_xscrollcommand {}
# Geometry Management
$_entry_box->g_grid(
-in => $root,
-column => 1,
-row => 2,
-columnspan => 3,
-ipadx => 0,
-ipady => 0,
-padx => 0,
-pady => 5,
-rowspan => 1,
-sticky => "ew"
);
$_text_box->g_grid(
-in => $root,
-column => 1,
-row => 3,
-columnspan => 2,
-ipadx => 0,
-ipady => 0,
-padx => 0,
-pady => 0,
-rowspan => 1,
-sticky => "news"
);
$_label->g_grid(
-in => $root,
-column => 1,
-row => 1,
-columnspan => 3,
-ipadx => 0,
-ipady => 0,
-padx => 0,
-pady => 0,
-rowspan => 1,
-sticky => "ew"
);
$_textbox_horiz_scrollbar->g_grid(
-in => $root,
-column => 1,
-row => 4,
-columnspan => 2,
-ipadx => 0,
-ipady => 0,
-padx => 0,
-pady => 0,
-rowspan => 1,
-sticky => "ew"
);
$_textbox_vert_scrollbar->g_grid(
-in => $root,
-column => 3,
-row => 3,
-columnspan => 1,
-ipadx => 0,
-ipady => 0,
-padx => 0,
-pady => 0,
-rowspan => 1,
-sticky => "ns"
);
$_Start_Button->g_grid(
-in => $root,
-column => 1,
-row => 5,
-columnspan => 1,
-ipadx => 0,
-ipady => 0,
-padx => 0,
-pady => 0,
-rowspan => 1,
-sticky => ""
);
$_Stop_Button->g_grid(
-in => $root,
-column => 2,
-row => 5,
-columnspan => 2,
-ipadx => 0,
-ipady => 0,
-padx => 0,
-pady => 0,
-rowspan => 1,
-sticky => ""
);
# Resize Behavior
$root->g_grid_rowconfigure(1, -weight => 0, -minsize => 2, -pad => 0);
$root->g_grid_rowconfigure(2, -weight => 0, -minsize => 12, -pad => 0);
$root->g_grid_rowconfigure(3, -weight => 1, -minsize => 85, -pad => 0);
$root->g_grid_rowconfigure(4, -weight => 0, -minsize => 4, -pad => 0);
$root->g_grid_rowconfigure(5, -weight => 0, -minsize => 40, -pad => 0);
$root->g_grid_columnconfigure(1, -weight => 1, -minsize => 67, -pad => 0);
$root->g_grid_columnconfigure(2, -weight => 1, -minsize => 186, -pad => 0);
$root->g_grid_columnconfigure(3, -weight => 0, -minsize => 2, -pad => 0);
}
my($root) = Tkx::widget->new('.');
$root->g_wm_title('stackoverflow');
example::ui($root);
Tkx::MainLoop();
1;
"हमारा" अवमूल्यन है ... हमम –
इसके बारे में खेद है, लेकिन यह कोड उत्पन्न हुआ था। "मेरे" के लिए "हमारा" ढूंढें और बदलें, हालांकि एक आसान पर्याप्त फिक्स जैसा लगता है। – Akers
ऐप-इनगो: "हमारा" बहिष्कृत नहीं है। केवल अगर आप 5.5.4 का उपयोग करते हैं, तो यह चेतावनी देगा कि यह एक भविष्य का कीवर्ड है। –