[wxPython-users] Re: wx.RichTextCtrl cursor

Robin Dunn robin at alldunn.com
Sun Sep 9 14:27:08 PDT 2007


Steve Holden wrote:
> Chris Mellon wrote:
>> On 9/4/07, Steve Holden <steve at holdenweb.com> wrote:
>>> I am told (by a client: my Linux system is still in storage) that on
>>> some  platforms the cursor refuses to disappear from the RichtextCtrl
>>> even when it loses focus.
>>>
>>> This was very disappointing as I had written a chunk of code to
>>> demonstrate that (on Windows, which *is* available to me) the cursor
>>> disappears from the control when focus is taken away.
>>>
>>> I attach the code, which on Windows makes the cursor disappear every
>>> time the timer ticks.
>>>
>>> Can anyone tell me a way to remove the cursor programmatically from the
>>> control even on platforms where this program doesn't do so?
>>>
>>> regards
>>>   Steve
>>> -- 
>>
>> <code snipped>
>>
>> It looks like this has to do with the implementation of wxCaret. On
>> MSW, there's a native GDI object for implementing carets, and thats
>> what used so the system handles the case when the app doesn't have
>> focus. On Gtk and OS X the generic implementation is used, which
>> doesn't check for the wxApp activity. It would be fairly easy to add
>> it, but I don't know enough (anything) about the platform conventions.
>> It's also possible that there could/should be a native implementation
>> of wxCaret for those platforms. This would be a good topic for wx-dev.
>>
>> As a workaround, try this:
>>
> [...]
> 
> On my Windows machine I needed to interchange the calls to Show() and 
> Hide() to make the caret disappear. I fear I misunderstood something, 
> though, as the following program doesn't make the cursor disappear on 
> Linux, but does on Windows. What am I doing wrong/,misunderstanding?

The RTC is showing it again when it gets the focus event.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list