Hi,

On 17/06/2013 08:22, Helen Craigman wrote:

But, When I go, according to your suggestion:
$panel2->InitDialog;
It bumps with:
"Can't locate object method "InitDialog" via package "Wx::Panel" at" ...
etc.
Should I add something?

Indeed you are right. The InitDialog method is missing from wxPerl. It will be in the next release. However, in the meantime it is simple to implement your own equivalent ( which is just a copy of what the C++ code does)

sub MyInitDialog {
    my $self = shift;
    $self->TransferDataToWindow();
    # Nudge window to update.
    $self->UpdateWindowUI(Wx::wxUPDATE_UI_RECURSE());
}

1. Why are validators implemented using cloning? Why is it necessary?

It is part of the wxWidgets internal implementation to allow passing events across wxWidgets threads. The wxPerl implementation simply wraps the underlying C++ implementation.


2. It's interesting to note that the need ( a must) to call GetValidator
is not mentioned in the (scarce) documentation (neither in the general
wxWidgets or wxPython one).

In normal usage you would not need to call GetValidator. Your validator and its methods are called as a result of library or code calls to the wxWindow methods TransferDataToWindow, Validate and TransferDataFromWindow. In all those cases there is never a need to call GetValidator.

Hope it helps.


Mark






Reply via email to