Hi,

Here is a Quick'n Dirty script.
In this example, I get the result of the 'qx' command and add it to the
'listBox' widget when i press the 'Dir' button (which return the result of
the MSDOS 'dir' command)

<script>
use Tk;
use Tk::Listbox;

my $top, $topFrame, $lowFrame, $listBox;
my $variable = "Toto";
my @choicesArray = ("One", "Two", "Three");

$top = MainWindow->new;
$topFrame = $top->Frame->pack(qw/-side top/);
$lowFrame = $top->Frame->pack(qw/-side top/);

$listBox = $topFrame->Listbox();
$topFrame->AddScrollbars($listBox);
$topFrame->configure(-scrollbars => 'e');
$listBox->insert(end, @choicesArray);
$listBox->activate(0);
$listBox->pack;

$lowFrame->Button(-text    => "Dir",
                  -width   => 15,
                  -command => sub { $listBox->insert(end,
qx/dir/); })->pack;
$lowFrame->Button(-text    => "Exit",
                  -width   => 15,
                  -command => sub { exit(0); })->pack;
MainLoop;
</script>
---

Legendo metulas imitabere cancrum

Olivier Gérault


_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to