|
|
@ -2,6 +2,7 @@ package Tk::Browser; |
|
|
|
|
|
|
|
|
|
|
|
use Tk; |
|
|
|
use Tk; |
|
|
|
use Tk::Font; |
|
|
|
use Tk::Font; |
|
|
|
|
|
|
|
use Tk::Balloon; |
|
|
|
use base 'Tk::ROText'; |
|
|
|
use base 'Tk::ROText'; |
|
|
|
use Cwd qw(abs_path); |
|
|
|
use Cwd qw(abs_path); |
|
|
|
|
|
|
|
|
|
|
@ -125,11 +126,40 @@ sub u_end |
|
|
|
delete $data->{tags}->{'<u>'}; |
|
|
|
delete $data->{tags}->{'<u>'}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub balloon_handle { |
|
|
|
|
|
|
|
my ($self) = @_; |
|
|
|
|
|
|
|
my ($x, $y) = ( |
|
|
|
|
|
|
|
$self->pointerx - $self->rootx, |
|
|
|
|
|
|
|
$self->pointery - $self->rooty); |
|
|
|
|
|
|
|
my $index = $self->index("\@$x,$y"); |
|
|
|
|
|
|
|
my @tags = $self->tagNames($index); |
|
|
|
|
|
|
|
for(@tags) { |
|
|
|
|
|
|
|
print; |
|
|
|
|
|
|
|
next unless /^<a.*href="(.*?)"/i |
|
|
|
|
|
|
|
and defined($1); |
|
|
|
|
|
|
|
$self->{msg} = $1; |
|
|
|
|
|
|
|
return "$x, $y"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sub a_begin |
|
|
|
sub a_begin |
|
|
|
{ |
|
|
|
{ |
|
|
|
# this assumes that no one will nest anchor tags ( a silly thing to do anyway ) |
|
|
|
# this assumes that no one will nest anchor tags |
|
|
|
|
|
|
|
#( a silly thing to do anyway ) |
|
|
|
|
|
|
|
|
|
|
|
my ($self, $tag, $data, $font) = @_; |
|
|
|
my ($self, $tag, $data, $font) = @_; |
|
|
|
|
|
|
|
unless(defined($self->{balloon})) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
$self->{msg} = "test"; |
|
|
|
|
|
|
|
$self->{balloon} = $self->parent->Balloon; |
|
|
|
|
|
|
|
$self->{balloon}->attach($self, |
|
|
|
|
|
|
|
-msg => \$self->{msg}, |
|
|
|
|
|
|
|
-balloonposition => 'mouse', |
|
|
|
|
|
|
|
-postcommand => [\&balloon_handle,$self], |
|
|
|
|
|
|
|
#-motioncommand => sub { print "erer"; 1; } |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
my ($href) = ($tag =~ m/href=\"(.*?)\"/i); |
|
|
|
my ($href) = ($tag =~ m/href=\"(.*?)\"/i); |
|
|
|
|
|
|
|
|
|
|
|