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

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

Black flowers blossom
Fearless on my breath

Comment on Re: TK binding
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2015-11-29 09:48 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls