Slider
A slider, horizontal or vertical
Slider(
range = (None, None),
default_value = None,
resolution = None,
tick_interval = None,
orientation = None,
border_width = None,
relief = None,
change_submits = False,
enable_events = False,
disabled = False,
size = (None, None),
font = None,
background_color = None,
text_color = None,
key = None,
pad = None,
tooltip = None,
visible = True,
size_px = (None, None)
)
Parameter Descriptions
Name | Type | Default | Description |
---|---|---|---|
background_color | str | None | color of slider's background |
border_width | int | None | width of border around element in pixels |
change_submits | bool | False | * DEPRICATED DO NOT USE. Use enable_events instead |
default_value | int or float | None | starting value for the slider |
disabled | bool | False | set disable state for element |
enable_events | bool | False | If True then moving the slider will generate an Event |
font | (str or (str, int[, str]) or None) | None | specifies the font family, size, etc. Tuple or Single string format 'name size styles'. Styles: italic * roman bold normal underline overstrike |
key | str or int or tuple or object | None | Value that uniquely identifies this element from all other elements. Used when Finding an element or in return values. Must be unique to the window |
orientation | str | None | 'horizontal' or 'vertical' ('h' or 'v' also work) |
pad | (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) | None | Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int) |
range | (int, int) or Tuple[float, float] | (None, None) | slider's range (min value, max value) |
relief | str or None | None | relief style. Use constants - RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID |
resolution | int or float | None | the smallest amount the slider can be moved |
size | (int, int) | (None, None) | (l=length chars/rows, w=width pixels) |
size_px | (int, int) or (None, None) | (None, None) | w=pixels-wide, h=pixels-high |
text_color | str | None | color of the slider's text |
tick_interval | int or float | None | how often a visible tick should be shown next to slider |
tooltip | str | None | text, that will appear when mouse hovers over the element |
visible | bool | True | set visibility state of the element |
Class Properties
This class has no public properties
Class Methods
def update
update
Changes some of the settings for the Slider Element. Must call Window.Read
or Window.Finalize
prior
Changes will not be visible in your window until you call window.read or window.refresh.
If you change visibility, your element may MOVE. If you want it to remain stationary, use the "layout helper" function "pin" to ensure your element is "pinned" to that location in your layout so that it returns there when made visible.
Parameter Descriptions
Name | Type | Default | Description |
---|---|---|---|
disabled | bool | None | disable or enable state of the element |
range | (int, int) or Tuple[float, float | (None, None) | Sets a new range for slider |
value | int or float | None | sets current slider value |
visible | bool | None | control visibility of element |