Wx::Data::Control - Retrieving data asynchrounously for Wx control
In your controls classes you can simply add Wx::Data::Control to the base classes, this will give your the opportunity, provided that you have already spawned the Wx::Data::Manager, to refresh_data from a data source.
The response will be sent to the Populate method of the control that you'll have to implement according to the response sent, which essentially depends on the engine that you selected (so no surprise, using the HTTP engine will provide you a Wx::Data::Engine::HTTP::Response object).
See the Wx::Data::Manager for detailled explanation on how to connect to a data source and what engines are supported yet.
So in your controls you can do like this
package Control; use base qw/Wx::Frame Wx::Data::Control/; sub Populate { my $self = shift; my ($response) = @_; # hmm .. now would be the good time # to implement this since data should # be there anytime soon }
And later in your code
# that's very wxPerl'ish my $control = Control->new(undef, -1, 'test', [0,0], [10,10]); # will request the data source and send the result back to # our control instance by calling the Populate method. $control->refresh_data({ my => 'parameters' });
Ed Heil <ed@donorware.com>, Mike Schroeder <mike@donorware.com>, Eriam Schaffter <eriam@cpan.org>
Wx::Data::Manager, Wx::Data::Engine::*
To install Wx::Data::Request, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wx::Data::Request
CPAN shell
perl -MCPAN -e shell install Wx::Data::Request
For more information on module installation, please visit the detailed CPAN module installation guide.