ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Mozilla-Plugin/Plugin/Gtk.pm
(Generate patch)

Comparing Mozilla-Plugin/Plugin/Gtk.pm (file contents):
Revision 1.6 by root, Mon Mar 5 18:48:49 2001 UTC vs.
Revision 1.7 by root, Sat Jul 21 00:41:47 2001 UTC

1=head1 NAME 1=head1 NAME
2 2
3Mozilla::Plugin - embed perl into mozilla/netscape. 3Browser::Plugin - embed perl into a webbrowser using gtk.
4 4
5=head1 SYNOPSIS 5=head1 SYNOPSIS
6 6
7 <embed type="application/x-mperl-gtk" /> 7 <embed type="application/x-mperl-gtk" />
8 8
12 12
13=over 4 13=over 4
14 14
15=cut 15=cut
16 16
17package Mozilla::Plugin::Gtk; 17package Browser::Plugin::Gtk;
18 18
19use base Mozilla::Plugin; 19use base Browser::Plugin;
20 20
21use Gtk; 21use Gtk;
22 22
23$VERSION = 0.01; 23$VERSION = 0.01;
24 24
32 main Gtk; 32 main Gtk;
33} 33}
34 34
35sub window_new { 35sub window_new {
36 my $self = shift; 36 my $self = shift;
37 my $wi = shift; 37 my $wi = $_[0];
38 $self->SUPER::window_new(@_); 38 $self->SUPER::window_new(@_);
39 39
40 my $w = new Gtk::Plug $wi->{id}; 40 my $w = new Gtk::Plug $wi->{id};
41 if ($w->socket_window) { 41 if ($w->socket_window) {
42 $w->add(my $W = new Gtk::HandleBox); 42 $w->add(my $W = new Gtk::HandleBox);
46 $v->add(my $b = new Gtk::Button "get_url"); 46 $v->add(my $b = new Gtk::Button "get_url");
47 signal_connect $b clicked => sub { 47 signal_connect $b clicked => sub {
48 print "entry changed to ".($e->get_text)."\n";#d# 48 print "entry changed to ".($e->get_text)."\n";#d#
49 }; 49 };
50 $w->show_all; 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;
51 59
52 return $w; 60 return $w;
53 } else { 61 } else {
54 return (); 62 return ();
55 } 63 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines