Hello,

In a program I'm reading data from a file and then - since Tk GUI data fields are too narrow - I'm adding missing data as balloons.

This is a modul where I push a "\n" behind periods and commas in order to make balloons less wide.

$requirement=~s/. /.\\n/g; $requirement=~s/, /,\\n/g; push(@CHECKLIST,{ ... _4_requirement=>$requirement });

This is a part where I define Tk frames, an entry and a balloon:

my $article00_Tk=$L00_Tk->Frame()->pack(-side=>'left',-padx=>1,-pady=> +0); my $article00_L=$article00_Tk->Entry(-relief=>'ridge',-borderwidth=>2, +-text=>$CHECKLIST[0]->{_1_article},-font=>'Arial 8',-width=>15,-state +=>'disabled')->pack(); my $article00_L_Balloon=$article00_L->Balloon(); $article00_L_Balloon->attach($article00_L,-balloonposition=>'widget',- +msg=>$CHECKLIST[0]->{_4_requirement}); my $article00_Tk=$L00_Tk->Frame()->pack(-side=>'left',-padx=>1,-pady=> +0); my $article00_L=$article00_Tk->Entry(-relief=>'ridge',-borderwidth=>2, +-text=>$CHECKLIST[0]->{_1_article},-font=>'Arial 8',-width=>15,-state +=>'disabled')->pack(); my $article00_L_Balloon=$article00_L->Balloon();

If the same text is inserted manually (copy / paste) the inserted \n causes line break correctly, but if it's taken from an array the balloon is shown as a single line where \n is shown as a part of string.

a) $article00_L_Balloon->attach($article00_L,-balloonposition=>'wid +get',-msg=>" text ...."); b) $article00_L_Balloon->attach($article00_L,-balloonposition=>'wid +get',-msg=>$CHECKLIST[0]->{_4_requirement});

Do you have any idea what am I missing?

Thanks for help.

M


In reply to Balloons msg by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.