My vote is for Perl/Tk (mainly because I still use it a lot). It uses the basic widget callback paradigm which applies to many other systems,
and for that reason it's reasonable to learn.
And since one of my philosophies is "always show code", here's a very simple drawing program in Perl/Tk:
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my @lines;
my $mw = MainWindow->new;
my $c = $mw->Canvas(-width => 900, -height => 900,)->pack(-side => 'bo
+ttom');
$mw->Button(-text => $_->[0], -command => $_->[1])->pack(-side => 'rig
+ht') for
[ Exit => sub { $mw->destroy } ],
[ 'Clear Last' => sub { pop @lines; draw() } ],
[ 'Clear All' => sub { @lines = (); draw() } ];
$c->Tk::bind('<1>' => sub
{
push @lines, [ &xy ];
$c->Tk::bind('<Motion>' => sub { push @{ $lines[-1] }, &xy; draw() }
+ );
} );
$c->Tk::bind('<ButtonRelease-1>' => sub { $c->Tk::bind('<Motion>' => '
+') } );
MainLoop;
sub xy { $_[0]->XEvent->x, $_[0]->XEvent->y }
sub draw
{
$c->delete('pen');
@$_ >= 4 and $c->createLine(@$_, -smooth => 1, -width => 5, -tag =>
+'pen')
for @lines;
}
Maybe others can post a comparable program in other GUIs for comparison purposes.