Kodi Development  20.0
for Binary and Script based Add-Ons
Subclass - ControlSlider

Detailed Description

Used for a volume slider.

Class: ControlSlider(x, y, width, height[, textureback, texture, texturefocus, orientation])

The slider control is used for things where a sliding bar best represents the operation at hand (such as a volume control or seek control). You can choose the position, size, and look of the slider control.

Note
This class include also all calls from Control
Parameters
xinteger - x coordinate of control
yinteger - y coordinate of control
widthinteger - width of control
heightinteger - height of control
textureback[opt] string - image filename
texture[opt] string - image filename
texturefocus[opt] string - image filename
orientation[opt] integer - orientation of slider (xbmcgui.HORIZONTAL / xbmcgui.VERTICAL (default))
Note
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
After you create the control, you need to add it to the window with addControl().

v17 Python API changes:
orientation option added.

Example:

...
self.slider = xbmcgui.ControlSlider(100, 250, 350, 40)
...

Function Documentation

◆ getPercent()

getPercent ( )

Function: getPercent()


Returns a float of the percent of the slider.

Returns
float - Percent of slider

Example:

...
print(self.slider.getPercent())
...

◆ setPercent()

setPercent (   ...)

Function: setPercent(pct)


Sets the percent of the slider.

Parameters
pctfloat - Percent value of slider

Example:

...
self.slider.setPercent(50)
...

◆ getInt()

getInt ( )

Function: getInt()


Returns the value of the slider.

Returns
int - value of slider

v18 Python API changes:
New function added.

Example:

...
print(self.slider.getInt())
...

◆ setInt()

setInt (   ...)

Function: setInt(value, min, delta, max)


Sets the range, value and step size of the slider.

Parameters
valueint - value of slider
minint - min of slider
deltaint - step size of slider
maxint - max of slider

v18 Python API changes:
New function added.

Example:

...
self.slider.setInt(450, 200, 10, 900)
...

◆ getFloat()

getFloat ( )

Function: getFloat()


Returns the value of the slider.

Returns
float - value of slider

v18 Python API changes:
New function added.

Example:

...
print(self.slider.getFloat())
...

◆ setFloat()

setFloat (   ...)

Function: setFloat(value, min, delta, max)


Sets the range, value and step size of the slider.

Parameters
valuefloat - value of slider
minfloat - min of slider
deltafloat - step size of slider
maxfloat - max of slider

v18 Python API changes:
New function added.

Example:

...
self.slider.setFloat(15.0, 10.0, 1.0, 20.0)
...