Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: selecting all occurences in tk::text

by lamprecht (Friar)
on May 26, 2010 at 22:37 UTC ( [id://841836]=note: print w/replies, xml ) Need Help??


in reply to Re^2: selecting all occurences in tk::text
in thread selecting all occurences in tk::text

Hi,
use Tk; my $mw = tkinit; my $t = $mw->Text()->pack; $t->tagConfigure('foo', -background => 'yellow'); $t->insert('end',"foo\nbar\nbaz\nfoo\n"); $t->FindAll(qw/-exact -case foo/); $t->tagAdd('foo',$t->tagRanges('sel')); MainLoop;

See the tagRanges() and tagAdd() methods documented in Tk::Text

Cheers, Christoph
update: Added example

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2026-04-20 00:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.