From: Mattia B. \<mattia\.barbon\@libero\.it\> <mat...@li...> - 2006-08-17 12:21:55
|
Hi, > I am using the following in my Wx::TreeListCtrl.pm: > > use Exporter; > use base qw( Exporter); > use vars qw( $VERSION @EXPORT_OK ); > @EXPORT_OK =3D qw( wxTR_VRULE wxTR_SHOW_ROOT_LABEL_ONLY ); > > But when I try and use these in my script sample1.pl I get the followin= g > error: > > Undefined subroutine &Wx::TreeListCtrl::wxTR_VRULE called ... > > So if I create the functions as below, where I get the values from the > treelistctrl.h file. > > sub wxTR_VRULE { 0x8000 } > sub wxTR_SHOW_ROOT_LABEL_ONLY { 0x0002 } > > Is this the way to do this? Or is there a easier/better way where I can= > automatically export these constants. > > I do not know if I can use the tl_constants.cpp method or what else I n= eed > to do ? It depends. If you want the user to be able to do use Wx qw(treelistctrl constants); # note: use Wx you need to push the constants into @Wx::EXPORT_OK and simply #include "cpp/tl_constants.cpp". If you want the user to be able to use Wx::TreeListCtrl qw(treelistctrl constants); remove the sub definitions from lib/Wx/TreeListCtrl.pm , remove tl_constants.cpp and perldoc ExtUtils::Constants. > I have removed Wx::Mini. The reason I first used it was because I was > getting errors with wx_boot, but now the problems have gone, even when = I > remove the 'use Wx::Mini'. The reason is you probably use Wx somewhere else in the program. > How can I increment $VERSION? The moment I change it to 0.02 in my > TreeListCtrl.pm file I get an error on Wx::wx_boot as below. I tried to= > re-compile the XS files but still the error??? Recompiling is enough. Ae you sure the file was actually recompiled? HTH Mattia =0A=0A=0A________________________________________________________________= ___=0AMutui a tassi scontati da 30 banche. Richiedi online e risparmia. S= ervizio gratuito. =0Ahttp://click.libero.it/mutuionline=0A |