Thanks Chris Barker for the wx.Timer() tip. Hm. It makes sense. I'll try it out.
By the way, I'm having trouble *anyway* with using mouse clicks. I keep getting continued-selection behavior, which with help from the list I got rid of when I was using a double-click (by creating a mouse-up event and handling it). It's not clear to me where mouse clicks go (when the click is in an STC inside one panel of a frame, for instance), but I'll keep playing with it. The point here is that, if I don't want to make an onscreen button but just have the user click the mouse, I'm not sure how to do that reliably.
Charles Hartman
http://cherry.conncoll.edu/cohar
http://villex.blogspot.com
Charles Hartman wrote:
By the way, I'm having trouble *anyway* with using mouse clicks. I keep getting continued-selection behavior, which with help from the list I got rid of when I was using a double-click (by creating a mouse-up event and handling it). It's not clear to me where mouse clicks go (when the click is in an STC inside one panel of a frame, for instance), but I'll keep playing with it.
Well, the mouse events should go to the window they are generated in. If it' a simple wx.Window or wx.Panel, this should be pretty easy. However, there is sometimes an issue with the native control grabbing it first. As STC is written in wx, that shouldn't be a problem, however.
There is one issue. If you bind the event, then the control won't get it unless you call Event.Skip(). You may not want it to get it, if you want to stop the timer, but not do what might have otherwise happened. Try the enclosed code, I think it does what you want.
TimerDemo.py (2.08 KB)
ยทยทยท
--
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