Gapp::Meta::Widget::Native::Trait::Form - Form trait for widgets
Apply this traits to widgets that you want to use as forms.
use Gapp::Actions::Form qw( Ok ); Gapp::Window->new( traits => [qw( Form )], content => [ Gapp::HBox->new( Gapp::Entry->new( field => 'user.name' ), Gapp::Button->new( action => Ok ), ) ], );
The context is used to sync data between your objects or data structures and the form fields.
The stash is used to store the values of the form fields. Calling apply or ok on the form will update the values in the stash. Calling update on the form will update your field values with those in the stash.
apply
ok
update
If set to true and the form has a context, the objects in the context will be updated as the user updates the form. If you make changes to the objects, you will need to call update_from_context to see your changes reflected in the form.
true
context
update_from_context
Updates the stash and context with values from the form.
Destroys the form.
Calls close
close
Calls apply then close.
Returns a list of all the fields within the form.
Update the fields widgets with the values contained in the stash.
Update the stash with values in the field widgets.
Updates the stash using the context, then calls update.
Updates the stash using values in the form fields.
Jeffrey Ray Hallock <jeffrey.hallock at gmail dot com>
Copyright (c) 2011-2012 Jeffrey Ray Hallock. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Gapp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gapp
CPAN shell
perl -MCPAN -e shell install Gapp
For more information on module installation, please visit the detailed CPAN module installation guide.