Sunday, January 30, 2011

tk button with url link

use strict;
use warnings;
use Tk;
 
my $url = 'http://google.com';
my $mw = tkinit;
 
my $link = $mw->Button(
-textvariable => \$url,
-fg => '#0000FF',
-relief => 'flat',
-command => sub{system('start', $url)},  )->pack;
 
MainLoop;

No comments: