Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
Subclass - ControlProgress

Used to show the progress of a particular operation. More...

Classes

class  XBMCAddon::xbmcgui::ControlProgress
 

Functions

 XBMCAddon::xbmcgui::ControlProgress::setPercent (...)
 

Function: setPercent(percent)


Sets the percentage of the progressbar to show.
 
 XBMCAddon::xbmcgui::ControlProgress::getPercent ()
 

Function: getPercent()


Returns a float of the percent of the progress.
 

Detailed Description

Used to show the progress of a particular operation.

Class: ControlProgress(x, y, width, height, filename[, texturebg, textureleft, texturemid, textureright, textureoverlay])

The progress control is used to show the progress of an item that may take a long time, or to show how far through a movie you are. You can choose the position, size, and look of the progress 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.
filenamestring - image filename.
texturebg[opt] string - specifies the image file whichshould be displayed in the background of the progress control.
textureleft[opt] string - specifies the image file whichshould be displayed for the left side of the progress bar. This is rendered on the left side of the bar.
texturemid[opt] string - specifies the image file which should be displayed for the middl portion of the progress bar. This is the fill texture used to fill up the bar. It's positioned on the right of the <lefttexture> texture, and fills the gap between the <lefttexture> and <righttexture> textures, depending on how far progressed the item is.
textureright[opt] string - specifies the image file which should be displayed for the right side of the progress bar. This is rendered on the right side of the bar.
textureoverlay[opt] string - specifies the image file which should be displayed over the top of all other images in the progress bar. It is centered vertically and horizontally within the space taken up by the background image.
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().

Example:

...
# ControlProgress(x, y, width, height, filename[, texturebg, textureleft, texturemid, textureright, textureoverlay])
self.image = xbmcgui.ControlProgress(100, 250, 250, 30, 'special://home/scripts/test.png')
...

Function Documentation

◆ getPercent()

float XBMCAddon::xbmcgui::ControlProgress::getPercent ( )

Function: getPercent()


Returns a float of the percent of the progress.

Returns
Percent position

Example:

...
# getPercent()
print(self.progress.getPercent())
...

◆ setPercent()

void XBMCAddon::xbmcgui::ControlProgress::setPercent ( ...)

Function: setPercent(percent)


Sets the percentage of the progressbar to show.

Parameters
percentfloat - percentage of the bar to show.
Note
valid range for percent is 0-100

Example:

...
# setPercent(percent)
self.progress.setPercent(60)
...