Hey all. So I'm attempting to include mouse gestures as a part of a GUI I'm designing. I'm using the following code, and it works great HOWEVER only when the gesture is draw away from widgets/controls (such as buttons, statictext's, etc). If I start a gesture and cross the path of a widget, the gesture gets interrupted. Anyone know how I can use gestures on top of widgets? Thanks
Note: In the following code, drawing an 'L' closes the window. Code from: http://wiki.wxpython.org/AnotherTutorial
import wx
import wx.lib.gestures as gest
class MyMouseGestures(wx.Frame):
def __init__ (self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size=(600, 500))
panel = wx.Panel(self, -1)
mg = gest.MouseGestures(panel, True, wx.MOUSE_BTN_LEFT)
mg.SetGesturePen(wx.Colour(255, 0, 0), 2)
mg.SetGesturesVisible(True)
mg.AddGesture('DR', self.OnDownRight)
def OnDownRight(self):
self.Close()
class MyApp(wx.App):
def OnInit(self):
frame = MyMouseGestures(None, -1, "mousegestures.py")
frame.Show(True)
frame.Centre()
return True
app = MyApp(0)
app.MainLoop()