+# --mozembed runs Gtk2::MozEmbed as a subprocess, because MozEmbed
+# is very crashy.
+if ($mozembed) {
+ my $r = 0;
+
+ my $w = Gtk2::Window->new ();
+ my $vbox = Gtk2::VBox->new ();
+ my $moz = Gtk2::MozEmbed->new ();
+ my $bbox = Gtk2::HButtonBox->new ();
+
+ $vbox->pack_start ($bbox, 0, 0, 0);
+ $vbox->add ($moz);
+ $w->fullscreen ();
+ #$w->set_default_size (640, 480);
+ $w->add ($vbox);
+
+ $bbox->set_layout ('start');
+ my $bnext = Gtk2::Button->new ("Next slide");
+ $bnext->signal_connect (clicked => sub { $r = 0; Gtk2->main_quit });
+ $bbox->add ($bnext);
+
+ my $bback = Gtk2::Button->new ("Back");
+ $bback->signal_connect (clicked => sub { $r = 1; Gtk2->main_quit });
+ $bbox->add ($bback);
+
+ my $bquit = Gtk2::Button->new ("Quit");
+ $bquit->signal_connect (clicked => sub { $r = 2; Gtk2->main_quit });
+ $bbox->add ($bquit);
+ $bbox->set_child_secondary ($bquit, 1);
+
+ $w->signal_connect (delete_event => sub {
+ Gtk2->main_quit;
+ return FALSE;
+ });
+ $w->show_all ();
+
+ $moz->load_url ($ARGV[0]);
+ Gtk2->main;
+
+ exit $r;
+}
+