1Prima::Spinner(3) User Contributed Perl Documentation Prima::Spinner(3)
2
3
4
6 Prima::Spinner - Show a spinner animation
7
9 use Prima qw(Application Buttons Spinner);
10
11 my $mw = Prima::MainWindow->new(
12 size => [200, 400],
13 text => 'Button Example');
14
15 my $spinner = $mw->insert('Spinner',
16 style => 'drops',
17 size => [200,400],
18 growMode => gm::Center
19 );
20
21 my $button = $mw->insert(
22 'Button',
23 text => 'Start/Stop',
24 checkable => 1,
25 checked => 1,
26 origin => [0,0],
27 onClick => sub { $spinner->toggle },
28 growMode => gm::XCenter
29 );
30
31 run Prima;
32
34 Prima::Spinner provides a simple spinning animation with two designs
35 and the opportunity to specify the colors of the spinning animation.
36 This is useful to show an indeterminate progress of a running process.
37
39 You can determine the following properties:
40
41 Properties
42 active [BOOLEAN]
43 If now parameter is passed, by this method you can get the active
44 state of the spinning widget. '1' means that the spinner is
45 running, '0' that it is stopped. With active(1) you can start the
46 spinner animation, with active(0) you can stop it.
47
48 color COLOR
49 Inherited from Prima::Widget. "color" manages the basic foreground
50 color. Concrete for the spinner widget this means the background
51 color of the circle or the color of the active drops.
52
53 hiliteColor COLOR
54 Inherited from Prima::Widget. The color used to draw alternate
55 foreground areas with high contrast. For the spinner widget this
56 means the color of the arc. Only for circle style.
57
58 showPercent BOOLEAN
59 If set, displays completion percent as text. Only for circle style.
60
61 start
62 Same as active(1)
63
64 stop
65 Same as active(0)
66
67 style STRING
68 "style" can be 'drops', 'circle' or 'spiral'. 'drops' shows drops
69 that switches consecutively the color. With 'circle' an arc moving
70 around a circle is shown. 'spiral' shows a spinning spiral. The
71 default is 'drops'.
72
73 value INT
74 Integer between 0 and 100, showing completion perentage. Only for
75 circle style.
76
77 toggle
78 Same as " active(!active) "
79
81 Prima. Prima::Widget, examples/spinner.pl
82
84 Maximilian Lika
85
87 Copyright (C) 2017 by Maximilian Lika
88
89 This library is free software; you can redistribute it and/or modify it
90 under the same terms as Perl itself, either Perl version 5.22.2 or, at
91 your option, any later version of Perl 5 you may have available.
92
93
94
95perl v5.34.0 2021-07-22 Prima::Spinner(3)