On 3.1.2010 20:32, Steve Cookson wrote:
Hi Guys,

Wow, it's already 2010 (for those of you who use the Gregorian
calendar). I hope you all had a great Christmas break and that this year
turns out well for you.

I'm trying to implement some WP functionality in wx. Really all I need
to do is to edit a letter. I've looked at the wxPerl demo example and it
shows you how to maintain wxRichTextCtrl, but not the format of the
data. I'd like to have a number of letter templates (the doc says it's
custom XML), but I can't find the format, nor how to load or save documents.

So I'd load the letter using some sort of Load function, save the result
and edit in between.



Hi,

I've just spent a weekend implementing simple html editor with RichTextCtrl. It was somewhat daunting task, mainly due to discrepancies between the C++ API and the wxperl wrapper.
Anyway in the end I made it through (thanks to Mattia for help).

I don't know about th XML format, but here is how I get HTML from the widget:


 my $buffer = $richtext->GetBuffer;
 open(my $fh, '>', \my $html) || die 'cannot open';
  my $html_handler = Wx::RichTextHTMLHandler->new;
 $html_handler->SaveFile($buffer, $fh);

Reply via email to