wxWidgets - RichTextCtrl - Is ther one?

Thread Solved
Reply

Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

wxWidgets - RichTextCtrl - Is ther one?

 
0
  #1
Nov 7th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,258
Reputation: evstevemd has a spectacular aura about evstevemd has a spectacular aura about evstevemd has a spectacular aura about 
Solved Threads: 118
evstevemd's Avatar
evstevemd evstevemd is offline Offline
Nearly a Posting Virtuoso

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #2
Nov 7th, 2008
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??
Atheist: God is man made imagination, he doesn't exist!
Theist: It's okay, can you imagine anything else that doesn't exist?
Junior MD --- Python, C++ and PHP
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,018
Reputation: jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough jlm699 is a jewel in the rough 
Solved Threads: 249
Sponsor
jlm699's Avatar
jlm699 jlm699 is offline Offline
Knows where his Towel is

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #3
Nov 7th, 2008
Yes, RichTextCtrl is usable, I believe vegaseat has an example or two in the wx sticky thread on this forum.
1. Use Code Tags.
2. Homework? Show Effort.
3. Keep discussions on the forum: no PMs
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,275
Reputation: sneekula has a spectacular aura about sneekula has a spectacular aura about 
Solved Threads: 174
sneekula's Avatar
sneekula sneekula is offline Offline
Nearly a Posting Maven

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #4
Nov 7th, 2008
wx.TextCtrl has a wx.TE_RICH style, but it works under Windows only!
No one died when Clinton lied.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #5
Nov 8th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,258
Reputation: evstevemd has a spectacular aura about evstevemd has a spectacular aura about evstevemd has a spectacular aura about 
Solved Threads: 118
evstevemd's Avatar
evstevemd evstevemd is offline Offline
Nearly a Posting Virtuoso

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #6
Nov 8th, 2008
have you tried google? And what do you mean fly code? I'll have to check when I get time
Atheist: God is man made imagination, he doesn't exist!
Theist: It's okay, can you imagine anything else that doesn't exist?
Junior MD --- Python, C++ and PHP
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #7
Nov 8th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: alvinru is an unknown quantity at this point 
Solved Threads: 1
alvinru alvinru is offline Offline
Newbie Poster

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #8
Nov 9th, 2008
Originally Posted by MaxVK View Post
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 41
Reputation: MaxVK is an unknown quantity at this point 
Solved Threads: 1
MaxVK MaxVK is offline Offline
Light Poster

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #9
Nov 9th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: alvinru is an unknown quantity at this point 
Solved Threads: 1
alvinru alvinru is offline Offline
Newbie Poster

Re: wxWidgets - RichTextCtrl - Is ther one?

 
0
  #10
Nov 9th, 2008
Originally Posted by MaxVK View Post
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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC