Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks, this is surely a silly question, but I'm having some problems in finding an answer. I'm using the TK::Text widget and I need to find the position (indexes) of the selected text. To find the selected text is as easy as this:

$text->getSelected

But what about the exact positions? What I want to do is to format the selected portion of text, which is easy ... if I only know the positions of the selected text. I read the (huge) manual coming with Text, but didn't find any option. Thanks for pointing me to the light

Replies are listed 'Best First'.
Re: Perl Tk Text Selection
by Anonymous Monk on Mar 24, 2016 at 19:40 UTC

    I came up with the solution. Just use the indexes

    'sel.first' and 'sel.last'