Hi,
Wx::RichTextPrintout is not yet wrapped because you cannot use it from
Wx::RichTextPrinting. You would have to write your own equivalent of
Wx::RichTextPrinting in Perl if you wanted to access
Wx::RichTextPrintout directly.
If it were wrapped, you would need code something like:
my $printout = MyPrintout->new();
.....
package MyPrintout;
use strict;
use warnings;
use Wx;
use Wx::RichText;
use base qw( Wx::RichTextPrintout );
sub new {
my $class = shift;
my $self = $class->SUPER::new( @_ );
return $self;
}
sub OnPrintPage{
my ($self, $page) = @_;
.....
}
a good place to get better info on this stuff would be
http://perldoc.perl.org/perlobj.html
http://perldoc.perl.org/perltoot.html
Regards
Mark
On 06/05/2010 02:40, Steve Cookson wrote:
OK, so I think I didn't get that quite right. I've added a separate package
name and a 'use base', but it says the base is not found.
So now the code is:
package Wx::RichTextPrintout;
use Wx qw(:everything);
use base qw(Wx);
sub OnPrintPage{
my ($self, $page) = @_;
my $dc = self->GetDC();
if ($dc){
if (HasPage($page)){
$dc->DrawBitmap(Wx::Bitmap->new('/home/steve/Documents/logo.png',1,1));
Wx::RichTextPrintout::RenderPage($dc, $page);
return 1;
} else {
return 0;
}
}
But it's still not being called.
Regards
Steve