Posts: 1,662
Joined: Jun 2011
Reputation:
119
I'm afraid your spinning wheel issues have nothing to do with PyXBMCt. Normally, a script/program addon does not show any spinners unless you are explicitly doing so. If you are creating a plugin, for any plugin route that does not use xbmcplugin calls you need to set isFolder=False and do not set 'isPlayable' = 'true. Otherwise, Kodi waits for a content list/playable item showing a busy dialog.
Show your full source code so I could check it.
Posts: 1,662
Joined: Jun 2011
Reputation:
119
I'm glad you had this sorted out.
Posts: 7
Joined: Apr 2018
Reputation:
0
Hello Roman, good job, Can I translate part of your code in my Csharp code (KSharp) ?
Posts: 1
Joined: Apr 2018
Reputation:
0
Hi,
I want to create a list and set a selected item but I don't found any solution in doc to set an item selected.
Thanks for advance for your help
Posts: 3
Joined: May 2018
Reputation:
0
2018-05-20, 18:02
(This post was last modified: 2018-05-20, 18:04 by toall1985.
Edit Reason: Trying to get code to show properly
)
Hi,
I am trying to use pyxbmct to create a python training program to be able to mimic IDLE on the left half of the screen and a tutorial video playing on the right. I have only just started trying today but think I have hit a snag in the fact when I press Enter it pulls up the keyboard where as ideally I would like it to drop down a line instead. Is there any way you can think of working around this? Many thanks in advance. Below is the code used for gui..
called from default using - elif mode == 1: from lib import Gui; myaddon = Gui.MyAddon('PyXBMCt Example'); myaddon.doModal(); del myaddon
running with -
import pyxbmct, xbmcplugin, xbmcgui, xbmc
# Create a class for our UI
class MyAddon(pyxbmct.AddonDialogWindow):
def __init__(self, title=''):
"""Class constructor"""
# Call the base class' constructor.
super(MyAddon, self).__init__('Piece of py - Python Training')
# Set width, height and the grid parameters
self.setGeometry(1300, 750, 100, 50)
# Call set controls method
self.set_controls()
# Call set navigation method.
self.set_navigation()
# Connect Backspace button to close our addon.
self.connect(pyxbmct.ACTION_NAV_BACK, self.close)
def set_controls(self):
"""Set up UI controls"""
# Image control
background = pyxbmct.Image(xbmc.translatePath('special://home/addons/plugin.video.pieceofpy/fanart.jpg'))
self.placeControl(background, -10, 0, 125, 55)
# Text label
label = pyxbmct.Label('Your Code:')
self.placeControl(label, 300, 250)
# Text edit control
self.name_field = pyxbmct.Edit('')
self.placeControl(self.name_field, -5, 0, columnspan = 25, rowspan = 100)
# Close button
self.close_button = pyxbmct.Button('Close')
self.placeControl(self.close_button, 4, 0, rowspan = 10, columnspan = 5)
# Connect close button
self.connect(self.close_button, self.close)
# Hello button.
self.hello_button = pyxbmct.Button('Hello')
self.placeControl(self.hello_button, 4, 1)
# Connect Hello button.
self.connect(self.hello_button, lambda:
xbmc.executebuiltin('Notification(Hello {0}!, Welcome to PyXBMCt.)'.format(
self.name_field.getText())))
def set_navigation(self):
"""Set up keyboard/remote navigation between controls."""
self.name_field.controlUp(self.hello_button)
self.name_field.controlDown(self.hello_button)
self.close_button.controlLeft(self.hello_button)
self.close_button.controlRight(self.hello_button)
self.hello_button.setNavigation(self.name_field, self.name_field, self.close_button, self.close_button)
#Set initial focus.
self.setFocus(self.name_field)
Obviously I need to edit the buttons after but wanted to see if this would work before I continue.