How to wrap text in a balloon in Perl / Tk

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

my code is like this

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

But this help text in a balloon goes beyond the screen. Is there a way to wrap the text displayed on the balloon?

+4
source share
1 answer

The Label widget inside the balloon is advertised as a β€œmessage” sub-widget and can be accessed directly using:

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

Here you can apply all the Tk::Label configure options, for example, the -wraplength :

 $balloon1_label->configure(-wraplength => 100); 
+2
source

Source: https://habr.com/ru/post/1485275/


All Articles