The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::Engine::Wx::Event - Catalyst wxPerl Engine events manager

SYNOPSIS

In your wx classes you can attach events the traditionnal way and then call the Catalyst controllers by calling CATALYST_EVT.

    # Attach events
    EVT_BUTTON( $self, $self->{button}, sub {
        CAT_EVT($self, 'Root->hello_world')
    });

You can pass parameters along with your event:

    EVT_BUTTON( $self, $self->{button}, sub {
        CAT_EVT($self, 'Root->hello_world', { message => $self->{message}->GetValue } )
    });

You can also name your controls and get them automatically added to your request's parameters, then you simply use the appropriate event for the control

        my $ctrl = Wx::TextCtrl->new($self, -1, "", wxDefaultPosition, wxDefaultSize);
    $ctrl->SetName('message');
    
    CAT_EVT_BUTTON( $self, $self->{button}, 'Root->hello_world');

    # Root->hello_world should receive a message parameter with the value stored in
    # the control

DESCRIPTION

Catalyst::Engine::Wx::Event is the module that you can use to attach events to your controls and to trigger Catalyst controllers.

CAT_EVT

Calls a Catalyst controller either by its path or by its representation. Where Root->hello_world is the representation of the hello_world sub in the Root module.

You can also call it with '/hello_world'.

The following is equivalent to loading the application if you have not defined a bootstrap option.

    CAT_EVT(undef, 'Root->default');

CAT_QUIT

This event quits the loop and exits the applications.

For exemple this exits the application when you close the window.

    EVT_CLOSE( $window, sub { CAT_EVT_QUIT; } );

AUTHORS

Eriam Schaffter, eriam@cpan.org and the Catalyst and wxPerl team.

COPYRIGHT

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.