• 1
  • 15
  • 16
  • 17(current)
  • 18
  • 19
  • 27
Release PyXBMCt: a Python framework for simple creating UI for XBMC addons
(2016-10-01, 17:11)unreal Wrote:
(2016-10-01, 14:23)Roman_V_M Wrote:
(2016-10-01, 09:34)unreal Wrote: How do I open this menu with a kodi listitem?

I can open the menu at the beginning of the addon. But I wanna open it with a listitem.

You mean like in a media plugin? There is no difference where to use PyXBMCt - on the module lever or in functions. Just put your PyXBMCt-related code into the part of your plugin that is called by the respective ListItem.

That sounds really easy, but how would that look like. I'm more a java programmer then a python programmer. Maybe that is why is harder for me to implement. Let me give you a idea of our addon. We have a for loop that parses urls from a website. And we add to that a web url link.

Our code is really basic.

This has nothing to do with Java vs. Python. For me, Kodi-Python API looks more like Java than Python. If you want to create a media plugin to present your media content in Kodi then you are using a wrong approach because your code makes no sense to me (why playlists?). There are 2 sticky topics in this forum section with video and audio plugin examples (I made the video example, actually). Look at those examples and try to make something similar.
Reply
You mean the tutorials from zag?
Reply
(2016-10-02, 18:34)unreal Wrote: You mean the tutorials from zag?

Yes (though the example video plugin was actually created by me). You need to create a proper plugin and then you can insert PyXBMCt-related stuff into one of your functions that are called depending on a plugin call URL and a query string. You don't see this URL (only in the Kodi log), it's used by Kodi internally and passed to a plugin in sys.argv. In this aspect a Kodi content plugin is very much like a web application that performs a set of actions (usually renders a certain web-page) depending on the provided URL and a query string (if any). Unlike a web-application, a plugin create a set of list items representing your media content or virtual folders that open lower level menus.
Reply
Version 1.2.0 has been released to the Kodi repo. In this version a new Estuary-based skin was added in addition to the old Confluence-based one. You can see the new PyXBMCt skin on th the screenshots in the 1-st post of this topic.

By default a skin is selected depending on Kodi version: Estuary-based one for 17.0 Krypton and above, and Confluence-based for earlier versions. However, a skin can be set explicitly. More info is here: http://romanvm.github.io/script.module.p...tuary.html

Also this release includes a fix for a long-standing bug with broken connection management in Blank* classes.

Also note the new URL for PyXBMCt documentation: http://romanvm.github.io/script.module.pyxbmct/
Reply
Hi There

I am trying to adjust the font size of controls such as list items , buttons , labels ect and can not seem to figure it out.
Also there a way to remove controls from the gui and then replace with another control so in other words remove a set of controls to make room for another set of controls

Any help would be much appreciated and great work thank you
Reply
(2016-10-25, 03:05)chris.jones1989 Wrote: Hi There

I am trying to adjust the font size of controls such as list items , buttons , labels ect and can not seem to figure it out.

Some Controls accept "font" argument that is a font alias from the current skin. For example, these are font aliases from Estuary skin.

However, it will work only in one skin. If a user changes skin, the default font from that skin will be used, so setting a specific font will only work if you are absolutely sure that your users will use only one skin or a limited set of skins.

Quote:Also there a way to remove controls from the gui and then replace with another control so in other words remove a set of controls to make room for another set of controls

Controls have SetVisible method that allows to hide and show Controls programmatically. Since Controls can occupy the same space inside a Kodi window, you can easily replace a Control or a group of Controls with another Control/Group by calling .setVisible(False)/setVisoible(True) for the respective Controls.
Reply
Hi Roman

Thank you for your quick response it is much appreciated

so i have tried what you set by using the setVisible() on the control but i get the following error in the kodi log: AttributeError: 'List' object has no attribute 'setVisbile'

This is the line of code i used - self.liveTVList.setVisbile(False)

I am also struggling to get the s[/code]et text from and edit input i have tried the following but with no luck :
[code]
def setCredentials(self):
username = self.usernameINP.getText()
password = self.passwordINP.getText()
print '********\nUSERNAME: ' + username + '\nPassword: ' + password + '*********************'


Any Help would be appreciated
Reply
2 chris.jones1989


Sorry, but your description is very vague. setVisible method (sorry for a typo in my post above, but you have figured it yourself) does exist and it does work. Please provide your full code and detailed descriptions of errors your are getting, not just "no luck". For large code samples it's better to use some external pastebin site with proper syntax highlighting and all.
Reply
Button executes script on plugin load not when the button is pushed/clicked why?

button1 = pyxbmct.Button('MYLIGHT')
window.placeControl(button1, 0)
window.connect(button1, subprocess.Popen(["c:\curl.exe", "http://MYTESTURL.COM:80/lights.php?onoff1"]))

Maybe another better way to do it?
Reply
(2016-11-13, 18:14)Hellcube Wrote: Button executes script on plugin load not when the button is pushed/clicked why?

button1 = pyxbmct.Button('MYLIGHT')
window.placeControl(button1, 0)
window.connect(button1, subprocess.Popen(["c:\curl.exe", "http://MYTESTURL.COM:80/lights.php?onoff1"]))

Maybe another better way to do it?

Hint: the documentation is your friend.Smile
Reply
(2016-11-14, 13:26)Roman_V_M Wrote:
(2016-11-13, 18:14)Hellcube Wrote: Button executes script on plugin load not when the button is pushed/clicked why?

button1 = pyxbmct.Button('MYLIGHT')
window.placeControl(button1, 0)
window.connect(button1, subprocess.Popen(["c:\curl.exe", "http://MYTESTURL.COM:80/lights.php?onoff1"]))

Maybe another better way to do it?

Hint: the documentation is your friend.Smile

It is my friend from now on Smile
Thank You. You did a great framework, it works perfectly...

Image
Reply
Hi

Just wondering if you could tell me if it is possible to add an image to a button using this framework. If so could you point me in the right direction.

Example:

I would like to use an image with a maintenance logo on it and use this as a button so i can have my own custom buttons.

Any help is much appreciated
Reply
(2017-01-04, 01:57)chris.jones1989 Wrote: Hi

Just wondering if you could tell me if it is possible to add an image to a button using this framework. If so could you point me in the right direction.

Example:

I would like to use an image with a maintenance logo on it and use this as a button so i can have my own custom buttons.

Any help is much appreciated

pyxbmct.Button that is a thin wrapper around xbmcgui.ControlButton uses 2 image files that define its appearance (a text label is optional):
noFocusTexture: displayed when a Button is not focused
focusTexture: displayed when a Button is focused, that is when you navigate to it with a keyboard/remote or hover a mouse pointer over it.
PyXBMCt provides its own default textures but you can override them using these keyword arguments to the class constructor.
Reply
(2017-01-04, 13:58)Roman_V_M Wrote:
(2017-01-04, 01:57)chris.jones1989 Wrote: Hi

Just wondering if you could tell me if it is possible to add an image to a button using this framework. If so could you point me in the right direction.

Example:

I would like to use an image with a maintenance logo on it and use this as a button so i can have my own custom buttons.

Any help is much appreciated

pyxbmct.Button that is a thin wrapper around xbmcgui.ControlButton uses 2 image files that define its appearance (a text label is optional):
noFocusTexture: displayed when a Button is not focused
focusTexture: displayed when a Button is focused, that is when you navigate to it with a keyboard/remote or hover a mouse pointer over it.
PyXBMCt provides its own default textures but you can override them using these keyword arguments to the class constructor.

Hi Roman_V, I noticed a typo in your documentation at line 473 if you view the source code.
After you create the control, you need to add it to the window with <code class="docutils literal"><span class="pre">palceControl()</span></code>.</p> Just giving you a heads up in case someone were to try to use it and get an exception,
Reply
@Protocol-X, thanks for noticing that!
Reply
  • 1
  • 15
  • 16
  • 17(current)
  • 18
  • 19
  • 27

Logout Mark Read Team Forum Stats Members Help
PyXBMCt: a Python framework for simple creating UI for XBMC addons4