943,741 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 2920
  • Python RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 7th, 2008
0

wxWidgets - RichTextCtrl - Is ther one?

Expand Post »
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
Reputation Points: 10
Solved Threads: 1
Light Poster
MaxVK is offline Offline
46 posts
since Nov 2008
Nov 7th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

In Wx demo, there is a nice example. I'm trying to do the same. It is new widget. Which version of wxpy are you using??
Reputation Points: 462
Solved Threads: 392
Senior Poster
evstevemd is offline Offline
3,681 posts
since Jun 2007
Nov 7th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

Yes, RichTextCtrl is usable, I believe vegaseat has an example or two in the wx sticky thread on this forum.
Reputation Points: 355
Solved Threads: 292
Veteran Poster
jlm699 is offline Offline
1,102 posts
since Jul 2008
Nov 7th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

wx.TextCtrl has a wx.TE_RICH style, but it works under Windows only!
Reputation Points: 961
Solved Threads: 211
Nearly a Posting Maven
sneekula is offline Offline
2,413 posts
since Oct 2006
Nov 8th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

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
Reputation Points: 10
Solved Threads: 1
Light Poster
MaxVK is offline Offline
46 posts
since Nov 2008
Nov 8th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

have you tried google? And what do you mean fly code? I'll have to check when I get time
Reputation Points: 462
Solved Threads: 392
Senior Poster
evstevemd is offline Offline
3,681 posts
since Jun 2007
Nov 8th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

Not 'fly code', I mean on the fly, as in added to the control at startup using code (as opposed to loading a file).

Anyway, yes, Iv been using Google for this, but Iv come up with nothing that actually gives a working control that can load and save RTF.

Max
Reputation Points: 10
Solved Threads: 1
Light Poster
MaxVK is offline Offline
46 posts
since Nov 2008
Nov 9th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

Click to Expand / Collapse  Quote originally posted by MaxVK ...
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
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.

This must be working on all the platforms supported by wxPython.

Alexei
Reputation Points: 10
Solved Threads: 1
Newbie Poster
alvinru is offline Offline
3 posts
since Nov 2008
Nov 9th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

Quote ...
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.
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
Reputation Points: 10
Solved Threads: 1
Light Poster
MaxVK is offline Offline
46 posts
since Nov 2008
Nov 9th, 2008
0

Re: wxWidgets - RichTextCtrl - Is ther one?

Click to Expand / Collapse  Quote originally posted by MaxVK ...
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
That's strange. I've successfully done it on Windows and I thought it should work on Linux too.

Anyway, I'm going to try it on Linux shortly, and will report back about what I've found out.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
alvinru is offline Offline
3 posts
since Nov 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: python+apache+gnome-open
Next Thread in Python Forum Timeline: Jython question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC