Kodi Community Forum

Full Version: Custom Window Directory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm currently writing an addon that will use a custom window to navigate through some menus, and would like to re-use the window.

The best way of doing this seems to be by using ActivateWindow() with the directory argument. Setting an item's onclick to
Code:
ActivateWindow(1151,"plugin://plugin.video.myaddon/SERVICES/ALL")
successfully changes to the custom window, but does not show the content from the plugin's URL. If I change the panel element in the window's XML to include a content element set to the same URL, everything works.

How do I get the directory argument to change the panel's content?
plugins can only use the standard kodi windows.

scripts, on the other hand, can ship with their own specific window(s)

and finally, activating a custom window is a skin thing.

you're trying to mix and match things that aren't supported.
OK, I think that makes sense now.

With a script, how would I define the information in a panel dynamically?
your script needs to fill the panel with listitems.

PHP Code:
panel self.getControl(123)

listitems = []

listitem xbmcgui.ListItem(label='my first item')
listitems.append(listitem)

listitem xbmcgui.ListItem(label='the second item')
listitems.append(listitem)

panel.addItems(listitems
Yup, definitely makes more sense now.

I've got that working, but how do I handle OnClick events from the ListItems? Setting their path attribute (during the object initialisation or vis setPath()) doesn't seem to do anything, and the window's onClick() function only sees the ID of the panel control (123 in your example)