Re: WxWindows Wx::Grid

"Bradley K. Embree" <[email protected]> Tue, 12 Jul 2016 12:59:12 -0700
Newsgroups gmane.comp.lang.perl.wxperl
Message-ID <[email protected]>
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=E2=80=99m thinking t=
hat 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 =E2=80=98BOMOPTION=E2=80=99=
 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_DELE=
TED);
>
> 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 f=
irst,
>      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_6=
4-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=E2=80=99ve searched around our installation, but cannot confirm (or d=
eny) that
> it is installed. Can anyone help me figure this out?
>
> Thanks!
> -----------------------
> Jim Clark <><
> [email protected] <mailto:[email protected]>
> 408-781-1425
>
> prepare yourselves...
>
>
>