Re: Text Selection Bug in ActiveState W32 Perl?
listmail <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
First thing that comes to mind is $widget->focus;
Craig M. Votava wrote:
>Vadim Konovalov wrote:
>
>
>>My feeling (I didn't inspected internals for this) is that selection is
>>wrongfully unseen at first because that was overlooked by author of
>>perl/Tk module, but then widget restores to its normal behavior.
>>
>>I think you should "simulate" switching forth and back to
>>enabled/disabled before actual work.
>>
>>Such tricks, when do not work with suggested "update", they usually work
>>with "afterIdle" call.
>>
>>HTH.
>>Vadim.
>>
>>
>
>Hmmm, using afterIdle didn't work either...
>
>Further investigation indicates that you need to
>have the flashing text cursor bar, flashing in the
>text window for selections to work at all (doesn't
>matter if state=>'normal' or state=>'disabled').
>Seems like the 'insert' mark has something to do
>with this.
>
>You can test this latest theory with the following code:
>
>use Tk;
>
>my $mw = MainWindow->new;
>my $text = $mw->Text(-state=>'normal')->pack;
>
>$text->insert('end',"one\ntwo\nthree\nfor\nfive\nsix\nseven\neight\nnine\nten\n");
>$text->mark('set','insert', '1.1');
>
>$mw->Button(
> -text => "selectall",
> -command => sub{$text->selectAll} )->pack;
>
>MainLoop;
>
>1.) When text window comes up, click on the selectall
>button. On my PC, nothing is shown as selected.
>
>2.) Now click somewhere in the text, so you have
>the flashing text cursor bar.
>
>3.) Now click on the selectall button. On my PC
>everything is marked as selected.
>
>Any other suggestions?
>
>Thanks
>
>-Craig
>-++**==--++**==--++**==--++**==--++**==--++**==--++**==
>This message was posted through the Stanford campus mailing list
>server. If you wish to unsubscribe from this mailing list, send the
>message body of "unsubscribe ptk" to [email protected]
>
>---------------------------------------------------------------------------------------------------
>Text inserted by Panda Platinum 2006 Internet Security:
>
> This message has NOT been classified as spam. If it is unsolicited mail (spam), click on the following link to reclassify it: http://127.0.0.1:6083/Panda?ID=pav_426&SPAM=true
>---------------------------------------------------------------------------------------------------
>
>
>
>
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]