Mouse events : release button 
Author Message
 Mouse events : release button

Hello,

Is there a command in Tk, that will allow me to bind the release of the
mouse button to a procedure? (The first mouse button is clicked, when it is
released, another procedure should be called.) Can you even do this in Tk?

This is what i have already:

bind .draw <Button-1> {OnMouseDown %x %y}
bind .draw <Button1-Motion> {OnMouseDrag %x %y}

# bind .draw <Button1??> {OnMouseUp %x $y}

In other words what command do i put in <Button1??> to bind a mouse button
release to the proc. OnMouseUp?

thanks a bunch!
Pritesh



Mon, 09 Apr 2001 03:00:00 GMT  
 Mouse events : release button

Quote:

> Hello,

> Is there a command in Tk, that will allow me to bind the release of the
> mouse button to a procedure? (The first mouse button is clicked, when it is
> released, another procedure should be called.) Can you even do this in Tk?

> This is what i have already:

> bind .draw <Button-1> {OnMouseDown %x %y}
> bind .draw <Button1-Motion> {OnMouseDrag %x %y}

> # bind .draw <Button1??> {OnMouseUp %x $y}

Try:
 bind .draw <Button1-ButtonPress> {OnMouseDown %x %y}
 bind .draw <Button1-Motion> {OnMouseDrag %x %y}
 bind .draw <Button1-ButtonRelease> {OnMouseUp %x $y}

I think that should work.
--
   Michael Bowler                     Phone:    613-765-3432
   IC Design Tools - 5T11             ESN:          39+53432



Tue, 10 Apr 2001 03:00:00 GMT  
 Mouse events : release button
Cool, I'll try that...

thanks! I think i'm starting to "get the hang" of tk!

Pritesh


Quote:

>> Hello,

>> Is there a command in Tk, that will allow me to bind the release of the
>> mouse button to a procedure? (The first mouse button is clicked, when it
is
>> released, another procedure should be called.) Can you even do this in
Tk?

>> This is what i have already:

>> bind .draw <Button-1> {OnMouseDown %x %y}
>> bind .draw <Button1-Motion> {OnMouseDrag %x %y}

>> # bind .draw <Button1??> {OnMouseUp %x $y}

>Try:
> bind .draw <Button1-ButtonPress> {OnMouseDown %x %y}
> bind .draw <Button1-Motion> {OnMouseDrag %x %y}
> bind .draw <Button1-ButtonRelease> {OnMouseUp %x $y}

>I think that should work.
>--
>   Michael Bowler                     Phone:    613-765-3432
>   IC Design Tools - 5T11             ESN:          39+53432




Tue, 10 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Filtering -browse with mouse button release

2. binding right mouse button click to all buttons

3. simulating button press and button release in menu

4. Binding mouse event to a canvas

5. Problem with mouse event to Tree

6. Newbie: Mouse events

7. Responding to mouse/keyboard events?

8. detecting mouse events with canvas widget

9. help binding mouse events to canvas

10. Tkperla4 w/ patches: menutest core dumps on mouse button press

11. Binding right mouse button for Tk::Tree items

12. overriding default right mouse button binding for text widget

 

 
Powered by phpBB® Forum Software