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

I am writing a program using Tkx::FindBar and a text widget.

I would like to know how to get the text selection into a variable after i find it and use that variable to put info into a sqlite database.

Replies are listed 'Best First'.
Re: Getting selection from Tkx text
by Anonymous Monk on Mar 27, 2013 at 07:07 UTC
    Just do it :)

        $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"});