Code Comments
Programming Forum and web based access to our favorite programming groups.Hi,
from the documentation to Tk::Text i concluded that i can get
the selection by:
$txt->get('sel.first', 'sel.last');
But i need to test if there IS a selection. To do this i
should test if the option "exportSelection" is true.
How do i do that? I tried:
$t->cget('exportSelection')
But that was always true. How do i test for the selection?
Best regards,
Torsten.
Post Follow-up to this messageIn article <chil14$bpn$1@schleim.qwe.de>, tmohr@s.netic.de says...
> Hi,
>
> from the documentation to Tk::Text i concluded that i can get
> the selection by:
>
> $txt->get('sel.first', 'sel.last');
Or via $txt->getSelected;
> But i need to test if there IS a selection. To do this i
> should test if the option "exportSelection" is true.
>
> How do i do that?
What's wrong with:
print "Nothing selected\n" unless $t->getSelected;
--
Go to http://MarcDashevsky.com to send me e-mail.
Post Follow-up to this messageHi, > Or via $txt->getSelected; that works, thanks! > What's wrong with: > > print "Nothing selected\n" unless $t->getSelected; I do not find any reference to "getSelected" in Tk::Text, even now that i know it exists. Else i think i would have used it. Thanks, Torsten.
Post Follow-up to this messageIn article <chnitd$a5l$1@schleim.qwe.de>, tmohr@s.netic.de says... > Hi, > > > that works, thanks! > > > I do not find any reference to "getSelected" in Tk::Text, > even now that i know it exists. Else i think i would have > used it. I'm running perl/Tk 804.027 and the getSelected method is documented, so perhaps the pod has been improved. -- Go to http://MarcDashevsky.com to send me e-mail.
Post Follow-up to this message"Marc Dashevsky" <usenet@MarcDashevsky.com> wrote in message news:MPG.1ba930a77a3566c0989a45@netnews.comcast.net... > In article <chnitd$a5l$1@schleim.qwe.de>, tmohr@s.netic.de says... > > I'm running perl/Tk 804.027 and the getSelected method is documented, > so perhaps the pod has been improved. Yes. I did that for 804; with the permission of O'Reilly publishing and Steve of course ;) As wonderful as Mastering Perl/Tk is - I got tired of having to always look them up. Surprisingly, the book binding has held up rather well around p.189 Jack
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.