#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::Balloon; my $tag_counter = 0; sub tag_and_balloonify { my ($text, $tag, $balloon, $x, $y) = @_; $tag .= ++$tag_counter; my %messages = (1 => 'hello', 2 => 'good'); my $message = $messages{$tag_counter}; $text->tagAdd($tag, $x, $y); $text->tagBind($tag, '', sub { $balloon->attach($text, -balloonmsg => $message, -initwait => 10, -balloonposition => 'mouse'); }); $text->tagBind($tag, '', sub { $balloon->detach($text) }); $text->tagConfigure($tag, -foreground => 'red'); } my $mw = tkinit(); my $text = $mw->Text->pack; my $balloon = $text->Balloon(); $text->insert('end', "This is a red text\n"); tag_and_balloonify($text, 'red_text', $balloon, '1.10', '1.13'); $text->insert('end', "This is another xxx text\n"); tag_and_balloonify($text, 'red_text', $balloon, '2.16', '2.19'); $mw->MainLoop(); #### ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,