Dialog.pl

From Organic Design wiki
Revision as of 08:28, 7 August 2011 by Nad (talk | contribs) (Here's a simple example of brining up a unicode-friendly dialog box in Perl using Tk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Here's a simple example of brining up a unicode-friendly dialog box in Perl using Tk, I had to first install the perl-tk package. <perl>

  1. !/usr/bin/perl -w

use Tk; use Tk::DialogBox; use Encode qw( encode decode );

$mw = MainWindow->new; $mw->withdraw();

$dialog = $mw->messageBox( -title => "A unicode dialog box!", -message => decode( "UTF-8", "Eu não gosto de leite" ), -buttons => [ "Ok" ] ); </perl>