QWizard::API - Generate questions using an API.
use QWizard::API; my $primaries = ( qw_primary('aprim', 'My title', 'An introduction', [ qw_text('textresult', 'Enter something'), qw_checkbox('checkresult', 'display results?', 1, 0)]); # ... );
QWizard::API is a wrapper around generating questions for use within a QWizard question set. Functionally, the only reason for doing this is to use an API instead of hand-encoding HASH and ARRAY structures. The result might be slightly less verbose, however, since the tags can be left off (I.E, name => 'something' becomes just 'something').
All of the APIs mentioned here take additional arguments at the end which can be other hash pairs passed to the created objects beyond the defaults that the APIs create.
Text entry: qw_text(name, question text); qw_textbox(name, question text);
Chekboxes: qw_checkbox(name, question text, optional:onval, optional:offval);
Menus/radios: qw_menu(name, question text, [values] | {labels}); qw_radio(name, question text, [values] | {labels});
Labels: qw_label(lefttext, righttext); qw_paragraph(lefttext, rightparagraph);
Hidden vars: qw_hidden(name, value);
Buttons: qw_button(name, question text, clicked value, button label);
OO interface.
qw_primary qw_text qw_textbox qw_checkbox qw_radio qw_menu
Wes Hardaker <hardaker@tislabs.com>
perl(1).
To install QWizard, copy and paste the appropriate command in to your terminal.
cpanm
cpanm QWizard
CPAN shell
perl -MCPAN -e shell install QWizard
For more information on module installation, please visit the detailed CPAN module installation guide.