Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^6: Getting selection from Tkx text

by Anonymous Monk
on Apr 02, 2013 at 02:10 UTC ( [id://1026563]=note: print w/replies, xml ) Need Help??


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

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

Sorry , see How do I post a question effectively? I'll be happy to take a look if you post a Short, Self Contained, Compilable, Example I can run and fixup

Replies are listed 'Best First'.
Re^7: Getting selection from Tkx text
by dabella12 (Acolyte) on Apr 03, 2013 at 16:51 UTC

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

      Well that doesn't compile Can't find string terminator "/" anywhere before EOF at blah.pl line 15.

      Even if I were to fix that typo, the typos just keep going

      Try again please

        Sorry the command should have read

        $text->g_bind('<Return>',sub{$name=$text->get(qw/sel.first sel.last/); +print "The name is $name\n"});

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-04-23 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found