13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

http://www.zetcode.com/wxpython/tips/Mouse gesturesA mouse gesture is a way of combining computer mousemovements and clicks which the software recognizes as aspecific command. We can find mouse gestures in suchsuccessfull applications like Firefox or Opera. <strong>The</strong>y reallyhelp users save their time while browsing on the Interent.Mouse gestures are created withwx.lib.gestures.MouseGestures class in <strong>wxPython</strong>.Available gestures:L for leftR for rightU for upD for down7 for northwest9 for northeast1 for southwest3 for southeastIf you wonder why these numbers were chosen, have a lookat the numerical pad. Mouse gestures can be combined. Thisway 'RDLU' is a mouse gesture triggered, when we do asquare with a mouse pointer.Possible flags are:wx.MOUSE_BTN_LEFTwx.MOUSE_BTN_MIDDLEwx.MOUSE_BTN_RIGHT#!/usr/bin/python# mousegestures.pyimport wximport wx.lib.gestures as gestclass MyMouseGestures(wx.Frame):def __init__ (self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(300, 200))panel = wx.Panel(self, -1)13 de 15 27/04/2008 1:09

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!