There are cases when a CallAfter can happen too soon. It
> this case it is possible that the code that sets initial
> focus to the first control is also happening in idle time
> and it just happens to be doing it after your SetFocus is
> called. For cases like this the easiest alternative is
> to use wx.FutureCall which is similar to wx.CallAfter but
> is based on a timer instead of posted events. Try this in
> your __init__ to cause the SetFocus to be called in 100 ms:
>
> wx.FutureCall(100, STC.SetFocus)
Yes! Robin D saves the day again. My STC is called WholeText, and when I added
wx.FutureCall(100, self.WholeText.SetFocus)
it worked just right. (At first I tried self.WholeText.SetSTCFocus, but that wanted another argument.)
Many thanks!
Charles Hartman
Professor of English, Poet in Residence
http://cherry.conncoll.edu/cohar
http://villex.blogspot.com