# MouseEvent#dragging

**URL:** <https://www.ruby-forum.com/t/mouseevent-dragging/171454>\
**Category:** wxRuby\
**Created:** [July 2, 2009, 6:41pm UTC](https://www.ruby-forum.com/t/mouseevent-dragging/171454 "2009-07-02T18:41:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimascyriaco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/958977/32.png) [@dimascyriaco](https://www.ruby-forum.com/u/dimascyriaco)\
**Post date:** [July 2, 2009, 6:41pm UTC](https://www.ruby-forum.com/t/mouseevent-dragging/171454/1 "2009-07-02T18:41:27Z")

</div>

I’m trying to use the dragging method of the MouseEvent, but with no  
success.  
Here is the code:

require ‘rubygems’  
require ‘wx’  
include Wx

class MyApp \< App  
def on\_init  
@frame = Frame.new(nil,-1, “Wx”, DEFAULT\_POSITION,  
Size.new(200,200))

```
evt_left_down() { | event | drag(event)}

@frame.show

```

end

def drag(event)  
puts event.dragging  
end  
end

app = MyApp.new.main\_loop

I always return false, even when i’m draging the mouse.  
I don’t know what is wrong.

Any help?  
Thanks
