Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Using Perl/Tk text tags

by {NULE} (Hermit)
on Jun 14, 2002 at 15:29 UTC ( [id://174568]=note: print w/replies, xml ) Need Help??


in reply to Using Perl/Tk text tags

Hi,

I can't see enough from your example to know if this will really help you. But the easiest thing to do is pass your text to your subroutine the bind method:

$lb->tagBind ('cr_link', "<Button-1>", [ \&show_cr, "cr_link" ]);
This may not work if you have multiple items tagged with 'cr_link'. To work around that you might have to loop through all of your items with that tag and bind them seperately so when the callback occurs you can tell them apart.
#psuedo code my $i = 0; my $h = {}; for (@tags) { $lb->tagConfigure("cr_link$i", -options => 'values'); $lb->tagBind("cr_link$i", "<Button-1>", [ \&show_cr, "$i" ]); $h->{$i} = "Something useful here like $text_of_lb->{$i}"; $i++; }

Again, psuedo-code so YMMV. Hope that helps,
{NULE}
--
http://www.nule.org

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2024-03-28 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found