2012-02-23, 15:35
Im playing this creating a custom dialog and so far have been using the code from script.rss.editor to help me get started. I have been able to strip all the unnecessary parts from it and get it to display correctly, but as soon as I add a new control to the xml file and some code that conforms to the code already in place I get the non-existent control error.
And the code from the xml file:
The complete error is as follows:
Whats interesting is the control is really just a copy of another that works properly. Any tips? Id be happy to use another approach if required, but seemed like the code in the rss editor was a good starting point.
Thanks
J
Code:
def defineControls(self):
#actions
self.action_cancel_dialog = (18, 20)
#control ids
self.control_heading_label_id = 2
self.control_list_label_id = 3
self.control_list_id = 10
self.control_changeSet_button_id = 11
self.control_add_button_id = 13
self.control_remove_button_id = 14
self.control_ok_button_id = 18
self.control_cancel_button_id = 19
self.control_headinga_label_id=20
self.heading_label = self.getControl(self.control_heading_label_id)
self.list_label = self.getControl(self.control_list_label_id)
self.list = self.getControl(self.control_list_id)
self.add_button = self.getControl(self.control_add_button_id)
self.remove_button = self.getControl(self.control_remove_button_id)
self.changeSet_button = self.getControl(self.control_changeSet_button_id)
self.ok_button = self.getControl(self.control_ok_button_id)
self.cancel_button = self.getControl(self.control_cancel_button_id)
self.headinga_label=self.getControl(self.control_headinga_label_id)
And the code from the xml file:
Code:
<control type="label" id="20">
<description>HeadingA Label</description>
<posx>0</posx>
<posy>0</posy>
<width>500</width>
<align>left</align>
<textcolor>dialogheader</textcolor>
</control>
The complete error is as follows:
Code:
08:25:25 T:3308 M:2406514688 NOTICE: File "C:\Program Files (x86)\XBMC\addons\plugin.test.dialog\default.py", line 124, in onAction
08:25:25 T:3308 M:2405986304 NOTICE: if action in self.action_cancel_dialog:
08:25:25 T:3308 M:2405986304 NOTICE: File "C:\Program Files (x86)\XBMC\addons\plugin.test.dialog\default.py", line 43, in onInit
08:25:25 T:3308 M:2405986304 NOTICE: self.defineControls()
08:25:25 T:3308 M:2405986304 NOTICE: File "C:\Program Files (x86)\XBMC\addons\plugin.test.dialog\default.py", line 73, in defineControls
08:25:25 T:3308 M:2405986304 NOTICE: self.headinga_label=self.getControl(self.control_headinga_label_id)
08:25:25 T:3308 M:2405986304 NOTICE: TypeError
08:25:25 T:3308 M:2405986304 NOTICE: :
08:25:25 T:3308 M:2405986304 NOTICE: Non-Existent Control 20
Whats interesting is the control is really just a copy of another that works properly. Any tips? Id be happy to use another approach if required, but seemed like the code in the rss editor was a good starting point.
Thanks
J