[wxPython] CaptureMouse Problem

Are you
running this under PythonWin, by any chance?

If you
are, try just running it from a command prompt.

Dale Strickland-Clark

Riverhall
Systems Ltd.
Custom database and Web applications.

Offices: London
& Wokingham

-----Original
Message-----
[mailto:xmonster0@msn.com]

···

From: Tyler foster
Sent: Tue, 2002 January 15 21:40
To: wxpython-users@lists.wxwindows.org
Subject: Re: [wxPython]
CaptureMouse Problem

def

OnMoveLeftDown(self, event):

    if event.LeftDown():

        print

‘capturing’

self.CaptureMouse()

        print

‘captured’ <–It prints this
then crashes

    elif event.Dragging():

        print 'dragging'

self.winPosition = self.GetPosition()

self.mousePosition = wxGetMousePosition()

        self.offsetx

= self.mousePosition[0] - self.winPosition[0]

        self.offsety

= self.mousePosition[1] - self.winPosition[1]

        print

‘offset set’

self.mousePosition = wxGetMousePosition()

self.winPosition[0] = self.mousePosition[0] - self.offsety

self.winPosition[1] = self.mousePosition[1] - self.offsetx

        print

‘moving’

self.Move(self.winPosition)

        print

‘moved’

elif event.LeftUp():

        print

‘releasing’

self.ReleaseMouse()

        print

‘released’

what I mean by
“Crashes” Is completly freezes some times if I take the focus off the
of the App and then focus back on it it unfreezes as long as I dont click on
the button again.

Tyler


Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com