Slider (hwx.gui)#

class Slider(orientation='horizontal', **kwds)#

Bases: Widget

A Slider Widget.

The Slider is the classic widget for controlling a bounded value.

A Slider Widget displays a range of values from which a user selects a single value between a minimum and a maximum value.

Slider widgets are usually created to control discrete integer values such as the number of coils of a coil spring .

Attribute Table#

Name

Type

maxvalue

property

minvalue

property

onSliderPress

Signal

onSliderRelease

Signal

pageStep

property

tracking

property

Example

from hwx import gui

# This method is invoked when the slider value is modified.
def onModified():
output.value = str(slider.value)

# Create a slider and a label to show its value
slider = gui.Slider(maxvalue=200, tracking=False, value=10,
command=onModified, )
output = gui.Label(slider.value)

frame = gui.HFrame(output, 5, slider)

show(frame)
property minvalue#

The minimum/left most value.

property maxvalue#

The maximum/right most value.

property tracking#

Doesn’t seem to do anything SetTickInterval SetLineStep

property pageStep#

The larger of two steps a slider provides corresponding to the user pressing PageUp or PageDown.

get()#

Returns the slider widget value.

set(value, emit=True)#

“Sets the slider widget value. :param value: Value to set. :type value: int :param emit: If False, no signals emitted on value change otherwise emit

the value change signal.