1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#!/usr/bin/perl -w
# $Id$
# TITLE: Mozilla embedding
# REQUIRES: Gtk Mozilla
use POSIX qw(getenv);
use Gtk::MozEmbed;
use MDK::Common;
use lib qw(/usr/lib/libDrakX);
use interactive;
use standalone;
# unless you use a threaded perl, you need to run this app with:
# LD_PRELOAD=libpthread-0.9.so or something like that to make use of networking
init Gtk;
Gtk->set_locale;
system("LD_PRELOAD=libpthread.so ; export LD_PRELOAD");
$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/;
#my $in = vnew interactive('su');
my $window = $::isEmbedded ? new Gtk::Plug ($::XID) : new Gtk::Window -toplevel;
$window->set_default_size(600, 400);
$window->signal_connect('destroy', sub {Gtk->main_quit});
my $box1= new Gtk::VBox($false,0);
my $event_box = new Gtk::EventBox();
$box1->add($event_box);
$event_box->show();
my $embed_moz= new Gtk::MozEmbed;
#$embed_moz->load_url(shift || "https://www.mandrake.com");
$embed_moz->render_data("hello world","/","text/html");
$embed_moz->open_stream("/","text/html");
$embed_moz->append_data("</html>\n</body>\nhello world\n</body>\n</html>\n");
$embed_moz->close_stream();
$event_box->add($embed_moz);
$embed_moz->show();
my $separator= new Gtk::HSeparator();
$box1->pack_start($separator,$false,$false,0);
$separator->show();
my $box2=new Gtk::HBox($false,0);
$box1->pack_start($box2,$false,$false,0);
$box2->show();
my $button_next= new Gtk::Button("Next");
$box2->pack_end($button_next,$false,$false,0);
$button_next->show();
my $button_prev= new Gtk::Button("Previous");
$box2->pack_end($button_prev,$false,$false,0);
$button_prev->show();
my $button_skipwiz= new Gtk::Button("Skip Wizard");
$button_skipwiz->signal_connect ( clicked => sub { Gtk->main_quit();});
$box2->pack_start($button_skipwiz,$false,$false,0);
$button_skipwiz->show();
$window->add($box1);
$box1->show;
$window->show;
main Gtk;
exit (0);
|