#!perl

use strict;
use warnings;
use Glib::Object::Introspection;

Glib::Object::Introspection->setup(
  basename => 'Gtk',
  version => '3.0',
  package => 'Gtk3');

Glib::Object::Introspection->setup(
  basename => 'WebKit',
  version => '3.0',
  package => 'WebKit');

Gtk3::init(0, []);

my $view = WebKit::WebView->new;

my $sw = Gtk3::ScrolledWindow->new;
$sw->add($view);

my $win = Gtk3::Window->new ('toplevel');
$win->set_default_size(800, 600);
$win->signal_connect(destroy => sub { Gtk3->main_quit });
$win->add($sw);
$win->show_all;

$view->open( $ARGV[0] // 'http://perldition.org' );

Gtk3->main;
