in reply to weird problem inserting an array into a Tk text widget

I'm guessing from the perldoc for Tk::Text, and it's insert method
If multiple chars-tagList argument pairs are present, they produce the same effect as if a separate insert widget command had been issued for each pair, in order. The last tagList argument may be omitted.
So possibly an unquoted array is interpreted as a set of char-tag pairs, so the tags (even numbers) don't get printed.

First time I saw that glitch. :-)


I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^2: weird problem inserting an array into a Tk text widget
by vkon (Curate) on Oct 16, 2008 at 13:16 UTC
    Indeed, 1st arg is index where to insert the text, 2nd is text, 3rd is tag, 4th is text 5th is tag - often used for text with non-trivial formatting...

    here is an excerpt from tk docs:

    pathName insert index chars ?tagList chars tagList ...? Inserts all of the chars arguments just before the character at index. + If index refers to the end of the text (the character after the last + newline) then the new text is inserted just before the last newline +instead. If there is a single chars argument and no tagList, then the + new text will receive any tags that are present on both the characte +r before and the character after the insertion point; if a tag is pre +sent on only one of these characters then it will not be applied to t +he new text. If tagList is specified then it consists of a list of ta +g names; the new characters will receive all of the tags in this list + and no others, regardless of the tags present around the insertion p +oint. If multiple chars-tagList argument pairs are present, they prod +uce the same effect as if a separate pathName insert widget command h +ad been issued for each pair, in order. The last tagList argument may + be omitted.