1API(3) User Contributed Perl Documentation API(3)
2
3
4
6 QWizard::API - Generate questions using an API.
7
9 use QWizard::API;
10
11 my $primaries =
12 (
13 qw_primary('aprim', 'My title', 'An introduction',
14 [ qw_text('textresult', 'Enter something'),
15 qw_checkbox('checkresult', 'display results?', 1, 0)]);
16 # ...
17 );
18
20 QWizard::API is a wrapper around generating questions for use within a
21 QWizard question set. Functionally, the only reason for doing this is
22 to use an API instead of hand-encoding HASH and ARRAY structures. The
23 result might be slightly less verbose, however, since the tags can be
24 left off (I.E, name => 'something' becomes just 'something').
25
27 All of the APIs mentioned here take additional arguments at the end
28 which can be other hash pairs passed to the created objects beyond the
29 defaults that the APIs create.
30
31 Primary creation To create a primary: qw_primary(name, title, introduction,
32 [questions], [post_answers], [actions])
33 Widget creation
34 Text entry:
35 qw_text(name, question text);
36 qw_textbox(name, question text);
37
38 Chekboxes:
39 qw_checkbox(name, question text, optional:onval, optional:offval);
40
41 Menus/radios:
42 qw_menu(name, question text, [values] | {labels});
43 qw_radio(name, question text, [values] | {labels});
44
45 Labels:
46 qw_label(lefttext, righttext);
47 qw_paragraph(lefttext, rightparagraph);
48
49 Hidden vars:
50 qw_hidden(name, value);
51
52 Buttons:
53 qw_button(name, question text, clicked value, button label);
54
56 OO interface.
57
59 qw_primary
60 qw_text
61 qw_textbox
62 qw_checkbox
63 qw_radio
64 qw_menu
65
67 Wes Hardaker <hardaker@tislabs.com>
68
70 perl(1).
71
72
73
74perl v5.30.0 2019-07-26 API(3)