Is there some other information that I should include in this?

Brian Jones
----- Original Message ----- From: "Brian Jones" <brian_jo...@intercept.com>
To: <wxperl-users@perl.org>
Sent: Monday, February 07, 2011 3:44 PM
Subject: Wx::PLGridTable and GetAttr


I have a large data set that I wanted represented on a Wx::Grid control using the Wx::PlGridTable as the interface between the table and the data objects. I've overloaded the GetAttr function for my table since I have some processing I needed done on the attributes based on the data.

The problem is that the GetAttr function is never called when the grid is painted. As a result all of the attributes for all of the cells are simply the defaults (white background, writable, black foreground, text editor).

Here is a snippet of my code, have I done somthing wrong?

################################################################################
package MyGridTable;
################################################################################


use strict;
use Carp qw( cluck carp croak confess );
use Data::Dumper;

use Wx;
use base qw( Wx::PlGridTable );
use Wx qw( :everything );

#######################################
sub new
#######################################
{
   my($class) = @_;
   my $this = $class->SUPER::new;
   return $this;
}

#...

#######################################
sub GetAttr
#######################################
{
   my ($this, $row, $col, $kind) = @_;

   my $attr = new Wx::GridCellAttr();
#  ... do things to attribute based on data object
   return $attr;
}

1;

Later in the code this is assigned to the grid in this manner...

my $gridTable = new MyGridTable();
$grid->SetTable( $gridTable, 1 );

Any help would be appreciated.

Brian Jones=

Reply via email to