enable.slider module¶
-
class
enable.slider.
Slider
(**traits)[source]¶ Bases:
enable.component.Component
A horizontal or vertical slider bar
-
map_data
(x, y, clip=True)[source]¶ Returns a value between min and max that corresponds to the given x and y values.
- Parameters
x (Float) – The screen coordinates to map
y (Float) – The screen coordinates to map
clip (Bool (default=True)) – Whether points outside the range should be clipped to the max or min value of the slider (depending on which it’s closer to)
- Returns
value
- Return type
Float
-
map_screen
(val)[source]¶ Returns an (x,y) coordinate corresponding to the location of val on the slider.
-
set_endcap_percent
(percent)[source]¶ Sets the width of the endcap to be a percentage of the width of the endcap widget.
- Parameters
percent (float) – The percentage, between 0.0 and 1.0
-
set_endcap_pixels
(pixels)[source]¶ Sets the width of the endcap to be a fixed number of pixels
- Parameters
pixels (int) – The number of pixels wide that the endcap should be
-
set_slider_percent
(percent)[source]¶ Sets the width of the slider to be a percentage of the width of the slider widget.
- Parameters
percent (float) – The percentage, between 0.0 and 1.0
-
set_slider_pixels
(pixels)[source]¶ Sets the width of the slider to be a fixed number of pixels
- Parameters
pixels (int) – The number of pixels wide that the slider should be
-