| | |
wxWidgets - RichTextCtrl - Is ther one?
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 41
Reputation:
Solved Threads: 1
Hi there. I started with wxPython (Under Linux) a little while ago and I'm enjoying very much, however, there doesn't seem to be a control for working with Rich text.
Iv found a few articles (mostly dated a few years ago) that suggest that such a control is on its way, but I haven't found it yet and the RTF Demo that came with the wxWidgets does not actually load or save RTF files.
So, is there one?
Regards
Max
Iv found a few articles (mostly dated a few years ago) that suggest that such a control is on its way, but I haven't found it yet and the RTF Demo that came with the wxWidgets does not actually load or save RTF files.
So, is there one?
Regards
Max
Yes, RichTextCtrl is usable, I believe vegaseat has an example or two in the wx sticky thread on this forum.
•
•
Join Date: Nov 2008
Posts: 41
Reputation:
Solved Threads: 1
Thanks for your replies:
evstevemd: The demo example looks very nice, but the rich text that is shown is created on the fly in code. The actual control cannot load or save RTF files (at least in Linux).
jlm699: Yes, I found this example (Its an excellent thread and I spent ages reading through it!) but its only for Windows users. I'm not using windows and I still need an RTF control.
This has become a real problem for me. If there is no RichTextCtrl for Python under Linux then I'll have to move to a different language, which will be a shame, because I rather like Python. I find it a bit hard to believe that wxPython does not have any method to deal with RTF type files (By this I mean I'm happy to have an editor that uses HTML, just so long as it loads and saves the files properly).
Its a shame, but Iv a feeling that Ill have to move away from Python rather soon.
Regards
Max
evstevemd: The demo example looks very nice, but the rich text that is shown is created on the fly in code. The actual control cannot load or save RTF files (at least in Linux).
jlm699: Yes, I found this example (Its an excellent thread and I spent ages reading through it!) but its only for Windows users. I'm not using windows and I still need an RTF control.
This has become a real problem for me. If there is no RichTextCtrl for Python under Linux then I'll have to move to a different language, which will be a shame, because I rather like Python. I find it a bit hard to believe that wxPython does not have any method to deal with RTF type files (By this I mean I'm happy to have an editor that uses HTML, just so long as it loads and saves the files properly).
Its a shame, but Iv a feeling that Ill have to move away from Python rather soon.
Regards
Max
•
•
Join Date: Nov 2008
Posts: 3
Reputation:
Solved Threads: 1
•
•
•
•
Not 'fly code', I mean on the fly, as in added to the control at startup using code (as opposed to loading a file).
Max
Now you can load it back in by going to the File menu and selecting the Open command. In the Open dialog select "XML files" for File type so you can find the saved document.
This must be working on all the platforms supported by wxPython.
Alexei
•
•
Join Date: Nov 2008
Posts: 41
Reputation:
Solved Threads: 1
•
•
•
•
Max, you *can* load and save RTF files using wxRichTextCtrl, but they will be stored as XML files. Just fire up the wxPython demo, go to the wxRichTextCtrl specific demo, launch it, go to the File menu, select Save As, then select "XML files" for File type and save the document.
Now you can load it back in by going to the File menu and selecting the Open command. In the Open dialog select "XML files" for File type so you can find the saved document.
Alas, it doesn't work! The file is certainly saved in XML, but when it comes to loading it back again all you get is the XML code, and no nice formatting!
Max
•
•
Join Date: Nov 2008
Posts: 3
Reputation:
Solved Threads: 1
•
•
•
•
Ah, just for a moment there you gave me some hope!
Alas, it doesn't work! The file is certainly saved in XML, but when it comes to loading it back again all you get is the XML code, and no nice formatting!
Max
Anyway, I'm going to try it on Linux shortly, and will report back about what I've found out.
![]() |
Other Threads in the Python Forum
- Previous Thread: python+apache+gnome-open
- Next Thread: Jython question
| Thread Tools | Search this Thread |
alarm ansi assignment avogadro backend beginner binary bluetooth character cmd code customdialog cx-freeze data decimals dictionary directory drive dynamic error examples exe file float format function gnu graphics gui halp heads homework http ideas import input java leftmouse line linux list lists logging loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial ubuntu unicode urllib urllib2 variable ventrilo verify webservice wikipedia windows write wxpython xlib






