schnell18 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I have problem to get the Wx::DatePickerCtrl work properly. When I don't use "use Wx qw/:allclasses/;", then I will get error like "Error while autoloading 'Wx::wxDP_DROPDOWN'" for the following code:
#!/usr/bin/perl -w use strict; package MyApp; #use Wx qw[:allclasses]; use Wx qw[:misc :frame :datepicker]; use Wx::DateTime; use base qw(Wx::App); sub OnInit { my $self = @_; my $frame = Wx::Frame->new( undef, -1, 'A wxPerl App', wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxMAXIMIZE_BOX | wxCLOSE_BOX ); Wx::DatePickerCtrl->new($frame, -1, new Wx::DateTime(), wxDefaultP +osition, wxDefaultSize, wxDP_DROPDOWN); $frame->Center(); $frame->Show(); } MyApp->new()->MainLoop();
However, I don't want "use Wx qw/:allclasses/" as it will load too many controls than necessary. Please help figure out how to fix this problem. Thank you very much!

Replies are listed 'Best First'.
Re: wxDP_DROPDOWN constant autoload issue
by Anonymous Monk on Sep 22, 2012 at 21:22 UTC
Re: wxDP_DROPDOWN constant autoload issue
by stefbv (Priest) on Sep 22, 2012 at 19:07 UTC

    Use Wx::Calendar instead of Wx::DateTime and will work.

    Regards Ştefan.

      Thank you very much! It works as you said.