Add a use Wx::Grid before your use base statement:

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

I think that should make it work for you.

Brad


On 16-07-12 10:59 AM, Jim Clark wrote:
I need some help in debugging a WxWindows issue. I’m thinking that our
installation may be incomplete.  I have a class called wxGrid which is
derived from the base class Wx::Grid.

use strict;
package wxGrid;
use Date::Manip;
use Data::Dumper;
use units;
use Debug;
use Wx;
use base 'Wx::Grid';
use Wx::Event qw(
EVT_GRID_LABEL_LEFT_CLICK
EVT_GRID_LABEL_RIGHT_CLICK
EVT_GRID_CELL_CHANGE
EVT_GRID_CELL_LEFT_CLICK
EVT_GRID_CELL_RIGHT_CLICK
EVT_GRID_EDITOR_HIDDEN
EVT_GRID_EDITOR_SHOWN
EVT_GRID_COL_SIZE
EVT_GRID_SELECT_CELL
EVT_GRID_EDITOR_CREATED
);

I have re-factored this class so that I am now routinely adding and
subtracting columns from the grid for graphic efficiency purposes.
However, when columns are either added or deleted, it borks the grid
display, and refreshing the grid does nothing.  For example here is a
before and after sequence after deleting the ‘BOMOPTION’ column:



I have been researching, and the problem is due to some undocumented
procedure (figures!) after you add or delete columns from the grid,
which is outlined here:
http://wiki.wxperl.it/Wx::GridTableBase

The fix is to send a message to the grid when these changes occur.
However, it requires that you subclass from Wx::GridTableBase, to be
able to do this. So be it.

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

use Wx;
use base qw(Wx::PlGridTable);
use Wx qw(wxGRIDTABLE_NOTIFY_ROWS_INSERTED wxGRIDTABLE_NOTIFY_ROWS_DELETED);

However this does not work in our environment:

*TEST2* [ees-lin17]~/wip/n48/mlb> use wxcalypso bomtool
Base class package "Wx::PlGridTable" is empty.
     (Perhaps you need to 'use' the module which defines that package first,
     or make that module available in @INC (@INC contains:
/org/ees/tools/local/packages/P4/P4-2012.2.1/lib/site_perl/5.22.0
/org/ees/tools/local/packages/P4/P4-2012.2.1/lib/site_perl/5.22.0/x86_64-linux-thread-multi-ld
/org/ees/tools/local/bomtool/bomtool-wxcalypso/app
/org/ees/tools/local/packages/P4/P4-2012.2.1
/org/ees/tools/freeware/cpan/cpan-5.22.0/el-6-x86_64/lib/site_perl/5.22.0/x86_64-linux-thread-multi-ld
/org/ees/tools/freeware/cpan/cpan-5.22.0/el-6-x86_64/lib/site_perl/5.22.0 
/org/ees/tools/freeware/perl/perl-5.22.0/el-6-x86_64/lib/5.22.0/x86_64-linux-thread-multi-ld
/org/ees/tools/freeware/perl/perl-5.22.0/el-6-x86_64/lib/5.22.0
/org/ees/tools/version/bin .).
  at /org/ees/tools/local/bomtool/bomtool-wxcalypso/app/wxgrid.pm line 43.
BEGIN failed--compilation aborted at
/org/ees/tools/local/bomtool/bomtool-wxcalypso/app/wxgrid.pm line 43.
Compilation failed in require at
/org/ees/tools/local/bomtool/bomtool-wxcalypso/app/wxmain.pm line 157.
BEGIN failed--compilation aborted at
/org/ees/tools/local/bomtool/bomtool-wxcalypso/app/wxmain.pm line 157.
Compilation failed in require at
/org/ees/tools/local/bomtool/bomtool-wxcalypso/app/main.pl line 439.

We have wxwidgets 3.0.2 + Alien-wxWidgets-0.67.
I’ve searched around our installation, but cannot confirm (or deny) that
it is installed. Can anyone help me figure this out?

Thanks!
-----------------------
Jim Clark <><
j...@jimclark.net <mailto:j...@jimclark.net>
408-781-1425

prepare yourselves...



Reply via email to