Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Getting selection from Tkx text

by Anonymous Monk
on Mar 27, 2013 at 07:45 UTC ( #1025640=note: print w/ replies, xml ) Need Help??


in reply to Re: Getting selection from Tkx text
in thread Getting selection from Tkx text

http://docs.activestate.com/activeperl/5.16/lib/Tkx.html
-> http://www.tcl.tk/man/tcl/TkCmd/contents.htm
-> http://www.tcl.tk/man/tcl/TkCmd/text.htm
Ctrl+F "sel"
-> THE SELECTION
-> pathName get ?-displaychars? ?--? index1 ?index2 ...?
-> INDICES
-> tag.first
-> tag.last

$text->get(qw/ sel.first sel.last /);

I guess "GetSelected" is too simple of an API :)

Replies are listed 'Best First'.
Re^3: Getting selection from Tkx text
by dabella12 (Novice) on Mar 30, 2013 at 17:52 UTC

    $text->get(qw/ sel.first sel.last/) works if i highlight the text after i find it, but Tkx::FindBar already highlights the text so i should only have to hit enter to put it in a variable. i have setup my text widget to bind to enter. ex: $text->g_bind('<Return>',sub{ name = $text->get(qw/sel.first sel.last/);print "$name\n"});

      Is there a question in there?

        yes after finding the text using Tkx::FindBar i still have to hightlight it again and hit enter before i can get the result in a variable

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025640]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2016-07-28 13:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (255 votes). Check out past polls.