5

How can I wrap the text displayed in a balloon in Perl/Tk?

my code is something like this

my $balloon1 = $mw->Balloon();
my $txt = "file Name: ".$fileName."\n"."location: ".$path;
$balloon1->attach($button, -balloonmsg=>$txt);

But this help text in balloon goes out of screen boundaries. Is there a way to wrap the text displayed in a balloon?

Kadiam
  • 303
  • 4
  • 12
  • 2
    This may help you. [Text Widgets](http://perlguru.com/gforum.cgi?post=58879;search_string=balloon;guest=#58879) – hwnd Jun 09 '13 at 21:28

1 Answers1

3

The Label widget inside the Balloon is advertised as the "message" subwidget and may be accessed directly using:

my $balloon1_label = $balloon1->Subwidget('message');

You can apply all Tk::Label configure options here, for example the -wraplength option:

$balloon1_label->configure(-wraplength => 100);
Slaven Rezic
  • 4,571
  • 14
  • 12