As one last vain attempt, try posting a wxMouseEvent to
> the control:
> e = wx.MouseEvent(wx.wxEVT_LEFT_UP)
> self.ProcessEvent(e)
Hey, that works! Thanks very much! (Now I'll sit here for a bit and try to understand *why* it works . . .)
As one last vain attempt, try posting a wxMouseEvent to
> the control:
> e = wx.MouseEvent(wx.wxEVT_LEFT_UP)
> self.ProcessEvent(e)
Hey, that works! Thanks very much! (Now I'll sit here for a bit and try to understand *why* it works . . .)
Charles Hartman wrote:
> As one last vain attempt, try posting a wxMouseEvent to
> the control:> e = wx.MouseEvent(wx.wxEVT_LEFT_UP)
> self.ProcessEvent(e)Hey, that works! Thanks very much! (Now I'll sit here for a bit and try to understand *why* it works . . .)
It sounds like you don't need it,but for completeness sake, there is:
wx.Window.HasCapture()
so you could do:
if self.HasCapture()
self.ReleaseMouse()
Though I don't know why there isn't a "Release the mouse if it's captured" method built in.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Charles Hartman wrote:
> As one last vain attempt, try posting a wxMouseEvent to
> the control:> e = wx.MouseEvent(wx.wxEVT_LEFT_UP)
> self.ProcessEvent(e)Hey, that works! Thanks very much! (Now I'll sit here for a bit and try to understand *why* it works . . .)
Because EVT_LEFT_UP is what the STC uses to know when to stop selecting text. With your event handler in place it is probably seeing the left down but is not able to see the left up event so its internal state thinks the mouse button is still pressed.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!