Looks like you've found (yet another :) bug in the Windows port of Perl/Tk. At least, I'm assuming you're running under Windows, because the following works fine under Linux:
#!/usr/bin/perl use Tk; use Tk::ROText; my $mw = MainWindow->new(); my $rot = $mw->ROText; $rot->pack; $rot->insert('end','foo '); $rot->insert('end','the bar',['mytag','sel']); $rot->insert('end',' baz'); MainLoop;
Of course, the same code does nothing under my Win32 box, so I'd assume that is the problem you are referring to. Unfortunatly, I could find no way around it -- normally $mw->idletasks() or $mw->update() fixes problems such as these, but had no effect here. I'll poke a bit more; but failing that, I don't see a simple answer. BTW, this problem is not limited to Tk::ROText -- it appears to be a problem even in Tk::Text. I'm amazed that nobody has noticed this before.
Of course, if you're running under Linux, then disregard all of the above, and take the above code as a working example. :)

In reply to Re: Waking up text select by Chmrr
in thread Waking up text select 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.