ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Mozilla-Plugin/Plugin/Gtk.pm
Revision: 1.7
Committed: Sat Jul 21 00:41:47 2001 UTC (22 years, 11 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +12 -4 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 =head1 NAME
2
3 Browser::Plugin - embed perl into a webbrowser using gtk.
4
5 =head1 SYNOPSIS
6
7 <embed type="application/x-mperl-gtk" />
8
9 =head1 DESCRIPTION
10
11 sorry...
12
13 =over 4
14
15 =cut
16
17 package Browser::Plugin::Gtk;
18
19 use base Browser::Plugin;
20
21 use Gtk;
22
23 $VERSION = 0.01;
24
25 sub mainloop {
26 my $self = shift;
27
28 init Gtk;
29 input_add Gtk::Gdk (fileno($self->server_fh), 'read', sub {
30 $self->server_event;
31 });
32 main Gtk;
33 }
34
35 sub window_new {
36 my $self = shift;
37 my $wi = $_[0];
38 $self->SUPER::window_new(@_);
39
40 my $w = new Gtk::Plug $wi->{id};
41 if ($w->socket_window) {
42 $w->add(my $W = new Gtk::HandleBox);
43 $W->add(my $v = new Gtk::VBox 5,5);
44 $v->add(my $e = new Gtk::Entry);
45 $e->set_text("http://www.plan9.de/");
46 $v->add(my $b = new Gtk::Button "get_url");
47 signal_connect $b clicked => sub {
48 print "entry changed to ".($e->get_text)."\n";#d#
49 };
50 $w->show_all;
51 $w->socket_window->set_events([qw(leave_notify_mask structure_mask enter_notify_mask exposure_mask focus_change_mask key_press_mask)]);
52 signal_connect $e key_press_event => sub {
53 warn Dumper ({key_press => \@_});
54 1;
55 };
56 use Data::Dumper;
57 warn Dumper $w->socket_window->get_events;
58 warn Dumper $w->window->get_events;
59
60 return $w;
61 } else {
62 return ();
63 }
64 }
65
66 sub DESTROY {
67 warn "DESTROY";
68 }
69
70 1;
71
72 =back
73
74 =head1 BUGS
75
76 =head1 SEE ALSO
77
78 L<PApp>.
79
80 =head1 AUTHOR
81
82 Marc Lehmann <pcg@goof.com>
83 http://www.goof.com/pcg/marc/
84
85 =cut
86