Kodi Community Forum
Bug Accessing slider control methods - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Bug Accessing slider control methods (/showthread.php?tid=181524)



Accessing slider control methods - powlo - 2013-12-28

I have this in a skin:

Code:
<control type="slider" id="22212">
      <description>My first slider control</description>
      <left>100</left>
      <top>570</top>
      <width>375</width>
      <height>30</height>
      <visible>true</visible>
      <texturesliderbar>osd_slider_bg_2.png</texturesliderbar>
      <textureslidernib>osd_slider_nibNF.png</textureslidernib>
      <textureslidernibfocus>osd_slider_nib.png</textureslidernibfocus>
</control>

Then in my (weather) script I have this:

Code:
slider = xbmcgui.Window(12600).getControl(22212)
percent = slider.getPercent()

Execution of the .getPercent() causes XBMC to crash. In fact, it seems as though accessing any property of the slider causes a crash*. There is nothing reported in the log file.

*after further experimentation it seems inherited, built in properties or methods do work. Eg __getattribute__(), __sizeof__(), __str__() all work.