Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: Getting selection from Tkx text

by Anonymous Monk
on Mar 31, 2013 at 01:00 UTC ( #1026314=note: print w/ replies, xml ) Need Help??


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

Is there a question in there?


Comment on Re^4: Getting selection from Tkx text
Replies are listed 'Best First'.
Re^5: Getting selection from Tkx text
by dabella12 (Novice) on Apr 01, 2013 at 15:22 UTC

    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

        Here is my code

        use Tkx; use Tkx::FindBar; use strict; use warnings; my $name; my $mw=Tkx::widget->new('.'); my $text=$mw->new_text(-width=>20,height=>10); my $findbar=$mw->new_tkx_FindBar(-textwidget=>$text); foreach(qw/David Mary William/) { $text->insert('end',"$_\n"); } $findbar->g_pack(); $text-g_pack(); $findbar->show(); $text->g_bind('<Return>',sub{$name=$text->get(qw/sel.first sel.last);p +rint "The name is $name\n"});

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2015-07-28 21:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (259 votes), past polls