v16 Custom Window Directory
#1
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?
Reply
#2
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.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
OK, I think that makes sense now.

With a script, how would I define the information in a panel dynamically?
Reply
#4
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
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
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)
Reply
#6
here's an example:
https://github.com/ronie/script.globalse...1077-L1081
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
Custom Window Directory0