I've discovered what appears to be a problem with the rich text control on osx.
When the control is set to read-only, and you select a range of text, the caret then appears in the control as if the control were editable.
The caret then remains in the control, at the current text output position, whether the control has the focus or not.
This is both ugly and inconsistent with the control's read-only state.
Can anyone verify whether this happens on any other platform?
Robin, is this a bug?
Sounds like it. Please create a ticket for it.
Hi Robin, I have more info on this now.
I had another widget in this window that is set to steal the focus (a
wx.Text that should always be focussed). When this widget 'steals' the
focus (by seeting focus to itself when it loses focus) the problem with
the wx.RichText occurs as described, when I turn off the focus stealing,
the caret still appears in the read-only wx.RichText on text selection,
but the caret _doesn't_ stay there when you move the focus out by
clicking on another widget...
Two questions:
1) Is the caret appearing on selection in a read-only wx.RichText still
a bug (I think it should be)?
2) Is the caret staying there when my other widget 'steals' the focus
back also a bug (seems like it might be to me)?
I've discovered what appears to be a problem with the rich text control on osx.
When the control is set to read-only, and you select a range of text, the caret then appears in the control as if the control were editable.
The caret then remains in the control, at the current text output position, whether the control has the focus or not.
This is both ugly and inconsistent with the control's read-only state.
Can anyone verify whether this happens on any other platform?
Robin, is this a bug?
Sounds like it. Please create a ticket for it.
Hi Robin, I have more info on this now.
I had another widget in this window that is set to steal the focus (a
wx.Text that should always be focussed). When this widget 'steals' the
focus (by seeting focus to itself when it loses focus) the problem with
the wx.RichText occurs as described, when I turn off the focus stealing,
the caret still appears in the read-only wx.RichText on text selection,
but the caret _doesn't_ stay there when you move the focus out by
clicking on another widget...
Two questions:
1) Is the caret appearing on selection in a read-only wx.RichText still
a bug (I think it should be)?
I don't know. Submit a ticket and see what Julian thinks.
2) Is the caret staying there when my other widget 'steals' the focus
back also a bug (seems like it might be to me)?
It may be an issue related to the order of the events causing an unexpected state in the RTC. For example, it may defer some of the processing for the gain focus event until later but before that happens it loses the focus. If that's the case then resetting the focus to your other widget via wx.CallAfter may help
1) Is the caret appearing on selection in a read-only wx.RichText still
a bug (I think it should be)?
I don't know. Submit a ticket and see what Julian thinks.
It must be a bug, it doesn't happen on windows or linux now that I've tested there.
Also, when you've made the caret "appear" in a read-only Richtext, the out put position is moved to that caret position, so subsequent output to the RichText happens at some random position relating to where you last made a selection...!
2) Is the caret staying there when my other widget 'steals' the focus
back also a bug (seems like it might be to me)?
It may be an issue related to the order of the events causing an unexpected state in the RTC. For example, it may defer some of the processing for the gain focus event until later but before that happens it loses the focus. If that's the case then resetting the focus to your other widget via wx.CallAfter may help
I changed my methos of keeping focus on that widget, it was causing problems with Choice controls on windows too. Now I have a a SetFocus event on all the other controls that puts the focus back where I want it, it works but it's ugly.
1) Is the caret appearing on selection in a read-only wx.RichText still
a bug (I think it should be)?
I don't know. Submit a ticket and see what Julian thinks.
It must be a bug, it doesn't happen on windows or linux now that I've tested there.
Also, when you've made the caret "appear" in a read-only Richtext, the out put position is moved to that caret position, so subsequent output to the RichText happens at some random position relating to where you last made a selection...!
Ok, created Ticket #10817 in the wxwidgets tracker.