Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: TK binding

by bbfu (Curate)
on Apr 08, 2004 at 22:58 UTC ( #343793=note: print w/ replies, xml ) Need Help??


in reply to TK binding

Have a binding for ButtonPress that sets a flag variable, as well as one for ButtonRelease that clears the flag. Then, have a binding for Motion that returns immediately if the flag is not set, otherwise processes the event normally. Something like:

my $flag = 0; $cnv_reference_ref->bind("location$x", '<B1-ButtonPress>' => [sub { $f +lag = 1 }, "$i", "1"]); $cnv_reference_ref->bind("location$x", '<B1-ButtonRelease>' => [sub { +$flag = 0 }, "$i", "1"]); $cnv_reference_ref->bind("location$x", '<B1-Motion>' => [sub { return +unless $flag; click_select(@_) }, "$i", "1"]);

bbfu
Black flowers blossom
Fearless on my breath


Comment on Re: TK binding
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-10-31 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (215 votes), past polls