peng3d.gui.slider
- Slider and Progressbar Widgets¶
-
class
peng3d.gui.slider.
Progressbar
(name, submenu, window, peng, pos=None, size=None, bg=None, nmin=0, nmax=100, n=0, border=[4, 4], borderstyle='flat', colors=[[240, 119, 70], [240, 119, 70]])[source]¶ Progressbar displaying a progress of any action to the user.
By default, this Widget uses
ProgressbarBackground
as its Background class.The border and borderstyle options are the same as for the
peng3d.gui.button.Button
Widget.The two colors given are for left and right, respectively. This may be used to create gradients.
nmin
,nmax
andn
represent the minimal value, maximal value and current value, respectively. Unexpected behavior may occur if the minimal value is bigger then the maximum value.-
n
¶ Property representing the current value of the progressbar.
Changing this property will activate the
progresschange
action.
-
nmax
¶ Property representing the maximum value of the progressbar. Typically
100
to represent percentages easily.
-
nmin
¶ Property representing the minimal value of the progressbar. Typically
0
.
-
-
class
peng3d.gui.slider.
ProgressbarBackground
(widget, border, borderstyle, colors)[source]¶ Background for the
Progressbar
Widget.This background displays a bar with a border similar to
ButtonBackground
. Note that two colors may be given, one for the left and one for the right.
-
class
peng3d.gui.slider.
Slider
(name, submenu, window, peng, pos=None, size=[100, 24], bg=None, border=[4, 4], borderstyle='flat', nmin=0, nmax=100, n=0, handlesize=[16, 24])[source]¶ Slider that can be used to get a number from the user.
By default, this Widget uses
SliderBackground
as its Background class.Most options are the same as for
Progressbar
.handlesize
simply determines the size of the handle.Note that scaling this widget on the y-axis will not do much, scale the handlesize instead.
-
p
¶ Helper property containing the percentage this slider is “filled”.
This property is read-only.
-
-
class
peng3d.gui.slider.
SliderBackground
(widget, border=[4, 4], borderstyle='flat')[source]¶ Background for the
Slider
Widget.This background displays a button-like handle on top of a bar representing the selectable range.
All given parameters will affect the handle.
-
class
peng3d.gui.slider.
VerticalSlider
(name, submenu, window, peng, pos=None, size=[24, 100], bg=None, border=[4, 4], borderstyle='flat', nmin=0, nmax=100, n=0, handlesize=[24, 16])[source]¶ Vertical slider that can be used as a scrollbar or getting other input.
By default, this Widget uses
VerticalSliderBackground
as its Background class.This widget is essentially the same as
Slider
, only vertical.Note that you may need to flip the x and y values of
size
,handlesize
andborder
compared toSlider
.
-
class
peng3d.gui.slider.
VerticalSliderBackground
(widget, border=[4, 4], borderstyle='flat')[source]¶ Background for the
VerticalSlider
Widget.This background uses the same technique as
SliderBackground
, simply turned by 90 Degrees.