Mark,

Thank you so much for your help.

I go to sleep on Friday evening and wake up on Saturday morning and it's all
there!

I haven't tried your code yet, I'm giving classes all day, but I'll check it
out this evening.

Jirí, thank you for your clarification.  It was exactly the problem I was
having.

Have a good weekend all.

Regards

Steve




-----Original Message-----
From: Mark Dootson [mailto:mark.doot...@znix.com] 
Sent: 09 October 2010 00:34
To: Steve Cookson
Cc: wxperl-users@perl.org
Subject: Re: Empty Wx::DatePickerCtrl

Hi,

Checked out how this works across wxMSW, wxGTK and wxMAC.

The following does what you want on all platforms:

my $dpick = Wx::DatePickerCtrl->new(
     $parent,
     -1,
     Wx::DateTime->new(),
     wxDefaultPosition,
     wxDefaultSize,
     wxDP_ALLOWNONE
);
my $date = Wx::DateTime->new();
$dpick->SetValue($date);

.......
.......

# get the value

my $newdate = $dpick->GetDate;
my $invaliddate = Wx::DateTime->new();
my $dateisvalid = ($newdate->IsEqualTo($invalidate)) ? 0 : 1;


Using ->SetValue after the constructor gets you what you want.


Regards

Mark


Reply via email to