wxRichTextCtrl sample error loading XML on OSX Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
djmig
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Feb 10, 2016 11:18 pm

wxRichTextCtrl sample error loading XML on OSX

Post by djmig »

Hi,
I tried richtext sample that comes with wxWidgets, and was surprised that while it compiled without any problem it cannot properly load saved XML and HTML. The saved files were created by saving the content of the sample itself to disk. While loading them through the sample, the cursor turned to the waiting (loading) cursor, and Force-Quit shows that the application is not responding:
forcequit.png
However, after 2-3 minutes the richtext sample loads XML (and HTML) source like so:
richtex-smallt.png
Can anyone confirm or help solve the issue?
Thanks.

----
Mac Book Pro 10.11 (El Capitan) wiih wxWidgets 3.1.1
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7478
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxRichTextCtrl sample error loading XML on OSX

Post by ONEEYEMAN »

Hi,
I think loading those files in wxRTC is not supported.
There was a recent thread about and the consensus was that OP was trying to implement this.

You can search this forum and find that.

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxRichTextCtrl sample error loading XML on OSX

Post by doublemax »

Loading XML should work, actually that's the only format that you can save and load without losing any information.

Saving as HTML is just an export, you can't load it back.
Use the source, Luke!
djmig
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Feb 10, 2016 11:18 pm

Re: wxRichTextCtrl sample error loading XML on OSX

Post by djmig »

Thank you both for anwering.

@ONEEYEMAN: I'm not sure which of these from search.php?keywords=wxrichtext+xml you were referring to.

@doublemax: Opening the saved XML file eventually worked, as shown by the second picture in the original question. But, shouldn't wxRichTextCtrl render the result as formatted text with pictures, just as in the original sample? What I mean is, shouldn't it look the same as the original sample?
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: wxRichTextCtrl sample error loading XML on OSX

Post by eranon »

Hello, If you pass the right type as second parameter to wxRichTextCtrl::LoadFile (ie. wxRICHTEXT_TYPE_XML), it should parse the XML file. One of my commercial apps built against wx 3.0 is using this under Windows and Mac without issue.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
djmig
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Feb 10, 2016 11:18 pm

Re: wxRichTextCtrl sample error loading XML on OSX

Post by djmig »

Thank you eranon, that answers my question. Silly of me for not realising it :oops:
Post Reply