Weird caret indentation in TextCtrl

61 views
Skip to first unread message

Thierry

unread,
Oct 31, 2012, 8:48:10 AM10/31/12
to wxpytho...@googlegroups.com
Hi,

I'm experiencing a weird problem with the flashing caret displayed in a TextCtrl.

After clicking in a TextCtrl, the caret is indented to the right. But when starting typing, the text is entered at the selected position.

Has anybody encountered this kind of problem ?

Regards,

Thierry.


Cody

unread,
Oct 31, 2012, 9:13:17 AM10/31/12
to wxpytho...@googlegroups.com
Hi,
Yes, I have seen the problem for a long long long long time in Editra
when I use it on Windows (never seen issue on other operating systems,
or on any of the other 100s of wx applications I have written). Have
tried debugging it many times, others have tried to help me debug it,
and I am still to this date defeated on this one.



Cody

Thierry

unread,
Oct 31, 2012, 10:25:14 AM10/31/12
to wxpytho...@googlegroups.com
I've not noticed this kind of problem until the use of "AuiManager" in my applications.

Have you also notice this ?

Thierry.

Cody

unread,
Oct 31, 2012, 10:30:48 AM10/31/12
to wxpytho...@googlegroups.com
Hi,

On Wed, Oct 31, 2012 at 9:25 AM, Thierry <thierry...@gmail.com> wrote:
> I've not noticed this kind of problem until the use of "AuiManager" in my
> applications.
>
> Have you also notice this ?
>

Its quite possible, that is probably about the only thing (due to
complexity) that I haven't tried taking out to see if the issue goes
away.

It was hard to date the problem to a change in my case because I
hardly ever used Windows in the early stages of the project and never
saw the problem on other systems. On Windows however the cursor seems
to bounce from about the middle of any of the TextCtrl's in the
application to the insertion point while typing.


Cody

Thierry

unread,
Nov 5, 2012, 4:12:28 AM11/5/12
to wxpytho...@googlegroups.com
Hi Cody,

In my application, I've got a class inheriting from Editra's class called "EdEditorView". The caret doesn't move anymore when the following line is commented :

self.Bind(wx.EVT_KILL_FOCUS, lambda evt: self.HidePopups())
 

Consequently I've changed the way HidePopups method is called :

class EditorView(ed_editv.EdEditorView) :

    def __init__(parent, *args, **kwargs) :
        ...
        self.Bind(wx.EVT_KILL_FOCUS, self.OnHidePopups)
        ...

    def OnHidePopups(self, evt) :
        self.HidePopups()
        evt.Skip()
 
I haven't noticed unexpected bounces in text controls since these few modifications.

Hope this helps,

Thierry.  

Cody

unread,
Nov 5, 2012, 4:17:30 PM11/5/12
to wxpytho...@googlegroups.com
Hi,

I can confirm an apparent improvement with this change. Will monitor
going forward.

Cheers,

Cody
Reply all
Reply to author
Forward
0 new messages