What IDs to use for custom windows
#1
I'm attempting to make a addon that will create it's own window, and I'm unsure which IDs I'm "allowed" to use. Obviously the IDs used by the XBMC core should be avoided, but is there a range of IDs that are recommended that should never conflict with XBMC.

Basically I'm wondering if XBMC is structured in a way similar to TCP/UDP port numbers where there's a range for common reserved services (XBMC core), a range for registered services (official addons/skins/etc), and the final range for dynamic/private/ephemeral services (unofficial addons/skins/etc)

I have already reviewed http://wiki.xbmc.org/index.php?title=Window_IDs but this doesn't tell me much more than what IDs are currently used, there's no way to know that if I pick a random number that it will still be safe a year down the road
Reply
#2
Python window ID's are assigned by XBMC. You can't set them.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#3
At the bottom of the page you will see a range set aside for Python - 3000-3099.
Reply
#4
Of what page? But there still set by XBMC.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#5
So if i write a service addon it's allowed to be bound to windows 3000-3099 without any conflict, assuming i use property names that are unique to my addon?

Edit: well apparently I'm not doing it right, I'm very inexperienced with xbmc addons/scripting (Window id does not exist if i try to use anything in the 3000-3099 range). Basically I'm trying to make an addon similar to the default weather addon that binds to a window and sets properties that can then be accessed from other windows. For testing purposes I just set the properties on the Home window, but to me that seems like a hacky way to do it and I guess I'm just asking what the proper way is
Reply
#6
@Nuka, I think this is what giftie is referring to: http://wiki.xbmc.org/index.php?title=Window_IDs

@antiroot, I think you can only set a property on a window if that window is showing? If you need info accessible from different places, I think the best option might be to just save a json string to a file
Reply
#7
(2013-03-20, 16:52)antiroot Wrote: For testing purposes I just set the properties on the Home window, but to me that seems like a hacky way to do it and I guess I'm just asking what the proper way is

If you want the properties to be available to any other window, I think the home window is probably a reasonable place for them. At least that's what I do with one of my addons, and I've seen some others do it that way as well. I do try and clean up all the properties I set when the script exits, although whether you want to do that or not depends a bit on your particular use case.

AFAIK, Home is one of the few windows that always exists, which is why it's convenient to stick stuff there.
Reply
#8
Thanks pkscuot and everyone else.

Yeah I got the idea of using the Home window from looking at other addons that are in the addon repository so I assumed it would work, i just felt it was a poor way to accomplish what I want. I just wish there was hidden window that always ran specifically for scripts to access. I'm still very new to scripting for xbmc and learning as I go, so I appreciate all the information everyone is willing to impart on to me.

now i'm starting to get a little off topic, but is there a recommended "standard" for property names for addons, one to avoid conflicts and two to not make a huge mess of cluttered names that have no organization
Reply
#9
Not sure it's necessary, but a dummy window might be a good feature suggestion. i remember Jezz_X thought a global way for scripts to set properties was a good idea, so maybe Team XBMC would consider it.

prepend your scripts id, if you're worried about conflicts.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#10
(2013-03-21, 16:18)antiroot Wrote: now i'm starting to get a little off topic, but is there a recommended "standard" for property names for addons, one to avoid conflicts and two to not make a huge mess of cluttered names that have no organization

I always use the name of my addon in the property name. So something like "ArtistSlideshowRunning" or "speedfan.panel.compact"
Reply

Logout Mark Read Team Forum Stats Members Help
What IDs to use for custom windows0