Thread Rating:
  • 0 Vote(s) - 0 Average
Non Existent Control Error
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.

def defineControls(self):
        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.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)

And the code from the xml file:

        <control type="label" id="20">
            <description>HeadingA Label</description>

The complete error is as follows:

08:25:25 T:3308 M:2406514688  NOTICE:   File "C:\Program Files (x86)\XBMC\addons\plugin.test.dialog\", 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\", 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\", 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.


You sure you got the whole XML correct? Invalid markup before the control or wrong placement in DOM tree can cause this.
Not sure, but will check when I get home. Is there a schema I can validate my file against?

Essentially all I have done is take one of the xml files, that comes with the rss editor, rename it and duplicate an existing control but used a new ID.
Not sure, but I don't think there exists any schema or DTD. It's pretty straightforward anyways. I'm not sure how the simple XML parser XBMC uses to parse the skin files handles syntax errors, but I think it do it silently.
Stupid user error on this, sorry! I had neglected to change the code that pointed to my xml from the one I grabbed from the xml editor. Things seems to be working on this now but it does lead me to my next question as the solution is non-obvious.

When I point to script-RSS_Editor-rssEditor.xml, the dialog renders perfectly of course. However, when I point to plugin-test-dialog.xml ( a direct copy of script-RSS_Editor-rssEditor.xml ), the dialog does render but its missing some of the chrome that I see in the other dialog.

Its missing/different:

* Not centered
* Close Button is missing
* Colors are different.
* Size is different.
* Text seems to be justified differently.

I have copied the complete skins directory to my test plugin.

Any thoughts?
Little bump. Can anyone tell me the mechanism that contributes the close button that normally appears in the upper right. My dialog is displaying but looks very unstyled.
jweber72 Wrote:Little bump. Can anyone tell me the mechanism that contributes the close button that normally appears in the upper right. My dialog is displaying but looks very unstyled.

Here's the code I use to create the close button:
<control type="button" id="200">
    <description>Close Window button</description>
I haven't found that image anywhere, so I'm beginning to wonder if it's buried in the Textures.xbt for the Confluence skin (which means my plugin isn't as skin independent as I thought). Unfortunately there doesn't seem to be any way to unpack the xbt file to confirm that.
Providing a debug log:

Add-ons I maintain:
Artist Slideshow: Add-on:Artist_Slideshow (wiki)
SpeedFan Information Display: Add-on:SpeedFan_Information_Display (wiki)
Yes thats definitely it... Thank you very much, I was assuming incorrectly that the window chrome ( including the close button ) was coming for free. Thats not the case.

I am wondering if coordinates are truly my issue with styling... Right now it looks the background image of the dialog is way out of proportion. Will read up on the relevant xml that controls this.

Thanks again!

Non Existent Control Error00