Kodi Community Forum
Removing label text? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+--- Thread: Removing label text? (/showthread.php?tid=77632)



Removing label text? - RandomXBMCUser - 2010-07-22

If I have two or more labels like so:
Code:
self.strAction = xbmcgui.ControlLabel(100, 100, 120, 200, '', 'font14', '0xFF00FF00')
self.addControl(self.strAction)
self.strAction.setLabel('Hello!')

self.strAction = xbmcgui.ControlLabel(100, 200, 120, 200, '', 'font14', '0xFF00FF00')
self.addControl(self.strAction)
self.strAction.setLabel('Hello! Part 2')

How do I remove all labels?

If I write self.removeControl(self.strAction), it only seems to remove the last label made.


- jmarshall - 2010-07-22

that's because self.strAction is overridden when you create your second label. Name them differently if you want to be able to remove them (or interact with them in other ways) later.


- RandomXBMCUser - 2010-07-22

Well, that was simple...many thanks!