Rick Zoerner wrote:
Hi all,
WinXP - Python 2.3.2 - wxPython 2.4.2.4u - unicode
I'm having difficulty saving and retrieving font attributes from a
wxTextCtrl. For some reason the normal TextCtrl method LoadFile isn't
working for me so I've stopped using the built-in SaveFile and LoadFile
methods.My problem is that I can get the TextCtrl to display the various font
attributes just fine, but when I save the file and read it back in I get
just the text in the default font. All the attributes and text formatting
have been lost. Looking at the saved file in another text editor, it doesn't
look like any additional (i.e. formatting) information is being saved other
than just straight text, but I could be wrong about that.
That is correct. The wxTextCtrl is meant to primarily be a plain text
editor. The attribute stuff was added fairly recently but it still
isn't enough to be a general purpose rich text editor, (personally I
think that that belongs in another class) but as just a way for the
program to highlight text if it needs to.
I think that there will be some better control of the attributes in
futurte versions but I think you'll still have to track and save the
attributes yourself. Having a good general purpose rich text editor is
on several people's wish lists, so it will hopefully happen someday soon.
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!