Release - PyXBMCt: a Python framework for simple creating UI for XBMC addons

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
jmarshall Offline
Team-XBMC Developer
Posts: 26,181
Joined: Oct 2003
Reputation: 176
Post: #16
There's a reason for that (no setID): The controlgroup holds a speedup mechanism in the form of an ID -> control* map for the constant "get control with id <foo>" that gets done. If you go and change the ID, then you'll need to update that map, which means that the child control needs public access to that function in the parent etc.

When you create a control from python, one of the things you provide is the ID, right? i.e. do you really need a way to set the ID from python?

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
divingmule Offline
Skilled Python Coder
Posts: 1,297
Joined: Oct 2008
Reputation: 61
Post: #17
(2013-10-08 01:34)jmarshall Wrote:  When you create a control from python, one of the things you provide is the ID, right?

Nope, no argument for ID.

Seems after creating a control, control.getId(), does return an ID. So.. I guess that doesn't explain why onFocus isn't working.
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #18
I have finished the QuickStart Guide for those who would want to use PyXBMCt for their addons.
Also I've added a clickable button to close a PyXBMCt window with mouse, like in Confluence skin dialogs.
Links and a screenshot in the OP are updated.

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
find quote
tycho-x Offline
Junior Member
Posts: 6
Joined: Aug 2013
Reputation: 0
Post: #19
Hi,

did you develop any "real" apps yet with the framework?

Sorry if its a dump question but i am just starting to school me on XBMC development and python:
Can i place graphic elements as well with your framework?

cheers,

Arnd
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #20
(2013-10-12 10:59)tycho-x Wrote:  Hi,

did you develop any "real" apps yet with the framework?

Yes, it started as UI for my private Addic7ed.com subtitles addon for TV series (no, I'm not going to release it publicly, so please don't ask), but then I've decided to re-work it as a general-purpose addon UI framework to hide the complexities of dealing with xbmcgui classes directly and to make is as much "pythonic" as possible.Smile Especially for those who are familiar with Tkinter, PyQt or other desktop Python GUI frameworks.

[Image: laa7.th.jpg]

Quote:Sorry if its a dump question but i am just starting to school me on XBMC development and python:
Can i place graphic elements as well with your framework?

Define "graphic elements". If you mean images, then yes, there is Image control based on xbmcgui.ControlImage. I'd recommend to read the QuickStart guide (it includes brief descriptions for available controls) and look into the example addon code.

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
(This post was last modified: 2013-10-12 23:15 by Roman_V_M.)
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #21
BTW, where should I report bugs found in some xbmcgui controls? XBMC.org does not have a link to Track anymore. Has it been deprecated?

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
find quote
Martijn Offline
Team-XBMC
Posts: 11,032
Joined: Jul 2011
Reputation: 158
Location: Dawn of time
Post: #22
(2013-10-15 10:54)Roman_V_M Wrote:  BTW, where should I report bugs found in some xbmcgui controls? XBMC.org does not have a link to Track anymore. Has it been deprecated?

still says "bugtracker" on the top bar of the forum Smile
put it under python/scripts component

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #23
I have decided to promote the current version to 1.0 release. Feel free to use it in your addons.Smile

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
find quote
Aweponken Offline
Junior Member
Posts: 12
Joined: Oct 2013
Reputation: 0
Post: #24
This is one awesome UI for beginners like me, thank you very much!
I have a few questions. Is it python or php you're writing as code? And is there any way to access the GPIO pins through your plugin?
I'm doing a plugin to turn lights on/off with a relay board, and I need to know if I can turn the pins on/off to trigger the relay.
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #25
(2013-10-24 17:36)Aweponken Wrote:  Is it python or php you're writing as code?

I guess, the topic title is pretty clear on that matter. As for the code examples in the OP, unfortunately the forum engine does not provide special code-highlighting facility for Python, so we have to use what's available.

Quote:And is there any way to access the GPIO pins through your plugin?

I have no idea what it means, but PyXBMCt is strictly a GUI framework for XBMC addons. If you need to add some business-logic on top of that, it's up to you how you code it.

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
find quote
nickr Online
Donor
Posts: 7,525
Joined: May 2009
Reputation: 128
Location: Christchurch NZ
Post: #26
GPIO = General Purpose Input Output - probably referring to the GPIO headers on a Raspberry Pi.

If I have helped you or increased your knowledge, click the plus button and increase my reputation :)
find quote
Aweponken Offline
Junior Member
Posts: 12
Joined: Oct 2013
Reputation: 0
Smile  RE: PyXBMCt: a Python framework for simple creating UI for XBMC addons
Post: #27
(2013-10-24 18:21)Roman_V_M Wrote:  
(2013-10-24 17:36)Aweponken Wrote:  Is it python or php you're writing as code?

I guess, the topic title is pretty clear on that matter. As for the code examples in the OP, unfortunately the forum engine does not provide special code-highlighting facility for Python, so we have to use what's available.
Sorry about that, got a little confused with the code examples.


(2013-10-25 07:55)nickr Wrote:  GPIO = General Purpose Input Output - probably referring to the GPIO headers on a Raspberry Pi.
Exactly, thank you! Any info about this Roman_V_M? Smile
find quote
el_Paraguayo Offline
Donor
Posts: 621
Joined: Feb 2011
Reputation: 14
Location: London, UK
Post: #28
The difficulty with accessing the Pi's GPIO pins is that they require root access and XBMCpython scripts don't run with superuser privileges.

If you want to use the pins to do something from a script I'd suggest starting a new thread as it's not particularly relevant to the PyXBMCt script. That way people can focus directly on helping you.

MythSuspendAlarm: Suspend and wake for next MythTV recording.
BBC Live Football Scores: Football scores notifications.
Random Movie Script: Play random movies from library.
find quote
hpooni Offline
Junior Member
Posts: 26
Joined: Dec 2010
Reputation: 0
Location: Mississauga, Ontario
Post: #29
I would like to use this framework in a plugin I'm working on for notification popups. The xbmc build-in notification is limited to single line of text and images don't seem to display on full-screen (when video is playing). Do you have controls (windows) pre-build I could utilize for this purpose.

Thanks for your hard work on this framework,
find quote
Roman_V_M Offline
Fan
Posts: 548
Joined: Jun 2011
Reputation: 14
Location: Kyiv, Ukraine
Post: #30
(2013-10-28 16:52)hpooni Wrote:  I would like to use this framework in a plugin I'm working on for notification popups. The xbmc build-in notification is limited to single line of text and images don't seem to display on full-screen (when video is playing). Do you have controls (windows) pre-build I could utilize for this purpose.

Thanks for your hard work on this framework,

AddonDialogWindow and BlankDialogWindow container classes are always displayed on top of XBMC UI, including video. On the previous page you can see a real add-on based on AddonDialogWindow class.
If you need to display your window only temporarily, you can use .show() method instead of doModal().
The following example will display a message window for 3 sec:
PHP Code:
import time
from pyxbmct
.addonwindow import *

message AdonDialogWindow('Message Header')
message.setGeometry(20010011)
label Label('Message text'alignment=alignment=ALIGN_CENTER)
message.placeControl(label00)
message.show()
time.sleep(3.0)
message.close() 
In this example the message window has only 1 control - a text label, but you can use all available controls in your own message window, including images.
The only drawback is that with show() you won't be able to close the window manually because show() method does not have an event loop, unlike doModal().

AMD A4-3300 + AsRock A75M-ITX
XBMC-DSplayer 13.1 (custom build) on Windows 7
(This post was last modified: 2013-10-28 17:31 by Roman_V_M.)
find quote
Post Reply