in reply to Waking up text select

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. :)

Replies are listed 'Best First'.
RE: Re: Waking up text select
by Anonymous Monk on Oct 09, 2000 at 08:14 UTC
    Thanks much for checking it out. You're right -- I am using Windows and the balance of my code is structurally like yours.
    After posting the problem, it occurred to me that examining Text.pm might offer some clues. After all, if manual text selections are handled in the module-level code via its own 'sel' mechanism, then I should be able to do so in my program too. But I haven't done that yet. It might also be that some lower-level communication with Windows handles the manual selecting; hence the discrepancy with Linux.