OK, I just found this on the recent changes circa wx 2.9.01 (I had upgraded
from 2.8 so wasn't aware of this change) [thanks, Werner, I see you also
just found that for me as well]:
"wx.richtext.RichTextCtrl and related classes were refactored such that the
RTC uses the same attributes object as wx.TextCtrl. This means that instead
of using wx.richtext.RichtextAttr or TextAttrEx you'll just use wx.TextAttr
instead. Also, all of the flags and styles related to the text attributes
have been moved out of the wx.richtext module and into the main wx
namespace. Finally, wx.TextCtrl and RichTextCtrl now share some common base
classes."
So based on that, I changed the line to use wx.TextAttr, and it got
further. The next error was this:
Traceback (most recent call last):
File "C:\Users\project\richTextPanel.py", line 547, in OnFont
attr.SetFlags(rt.TEXT_ATTR_FONT)
AttributeError: 'module' object has no attribute 'TEXT_ATTR_FONT'
So, based on the text in that Recent Changes note (" Also, all of the flags
and styles related to the text attributes have been moved out of the
wx.richtext module and into the main wx namespace"), I changed this line:
attr.SetFlags(rt.TEXT_ATTR_FONT)
to this:
attr.SetFlags(wx.TEXT_ATTR_FONT)
and it got further.
However, now I am getting another error, now in the wx.richtext module
itself:
Traceback (most recent call last):
File "C:\Users\project\richTextPanel.py", line 548, in OnFont
if self.rtc.GetStyle(self.rtc.GetInsertionPoint(), attr):
File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\richtext.py", line
3139, in GetStyle
return _richtext.RichTextCtrl_GetStyle(*args, **kwargs)
TypeError: in method 'RichTextCtrl_GetStyle', expected argument 3 of type
'wxRichTextAttr &'
Any ideas?
Thanks,
Che
···
On Wed, Jan 21, 2015 at 11:36 AM, C M <cmpython@gmail.com> wrote:
I upgraded to wxPython 3.0.1.1 and it seems to have broken my use of
wx.RichTextCtrl.