Dialog.pl

From Organic Design wiki
Revision as of 18:11, 22 May 2015 by 127.0.0.1 (talk) (Change source-code blocks to standard format)
(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.

#!/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" ]
);