#!/usr/bin/perl #by Jack D. # Just attach the balloon to the widget itself instead # of treating it like a canvas item. # The script below shows both. ## Example ## use Tk; use Tk::Balloon; use strict; my $mw=tkinit; my $c=$mw->Canvas->pack; my $l = $c->Label(-relief=>'sunken',-text=>'embedded window'); $c->create('window',150,150,-window=>$l); $c->create('text', 150,100,-text=>"A Text Canvas Item",-tags=>'TESTTAG'); my $ba = $mw->Balloon(-background=>'yellow'); $ba->attach($l,-initwait=>0,-balloonmsg=>'Attached to Widget'); $ba->attach($c, -initwait=>0, -balloonposition => 'mouse', -msg=>{ 'TESTTAG'=>'A Canvas Item'} ); MainLoop; __END__