Beginner Help with Script GUI and WindowXML
#1
Hey guys,

I have a script to cast videos from Kodi to a Chromecast. The casting part works fine, and now I'm just trying to create a GUI using WindowXML. I don't really have an experience programming / scraping with Kodi, but I've checked out the Wiki and used a couple of other scripts as starting points (script.favorites and script.globalsearch).

I've got it so that the video starts casting and then a window pops up (from script-chromecast-main.xml in the resources folder). It's a simple window for now (just for testing), so it's just a black background with five button controls : play, pause, stop, seek forward, and seek back. The buttons each have a control ID assigned to them.

Only problem is I can't get the buttons to actually do anything. The window with the buttons appear the way I expect them to, but clicking them does nothing. For testing, I changed the action of the play button to print("Playing") just to see if it would show in the log, but it doesn't. All I can ever get is ------ Window Deinit (Pointer.xml) ------.

Again, I really don't know what I'm doing, so I apologize in advance if this ends up being something dumb.

Here is the script: default.py

Here is the Window XML: script-chromecast-main.xml
(not sure if the window needs an ID or if type="dialog" is necessary, figured it would't hurt Confused)
Reply
#2
fix your indenting in the .py file.
sometimes you use 4 spaces, sometimes 8 or even 12.
indenting matters in python and could be the cause of your issue.

as for the xml file, specifying an id is not needed, it's assigned dynamically by kodi for python windows.
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
Wow sorry for that and thanks Ronie. I was using a text editor and it seemed like everything was lined up with the right spaces. I installed Sublime and it showed me how off it actually was. Thanks again!
Reply

Logout Mark Read Team Forum Stats Members Help
Beginner Help with Script GUI and WindowXML0