#!/usr/bin/env perl use strict; use warnings; use Tkx; my $mw = Tkx::widget->new("."); $mw->new_button( -text => "Hello, world", -command => sub { $mw->g_destroy; }, )->g_pack; my $text_widget = $mw->new_tk__text(-width => 40, -height => 10); $text_widget->g_pack; $text_widget->insert('1.0', 'Test text to test a text widget.'); Tkx::MainLoop();