• 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9
  • 27
Release PyXBMCt: a Python framework for simple creating UI for XBMC addons
#91
(2014-06-12, 13:17)Roman_V_M Wrote:
(2014-06-12, 12:12)Dipti Wrote: yes I used that both method setSetting() is working, but getSetting() is not returning any value.
I checked userdata->..->setting.xml is updated using setSetting. but stored value is not getting.

Then you must be doing something wrong, because the setSetting()/getSetting() does work. Here is the example of login function:
https://github.com/romanvm/ex.ua.alterna...lt.py#L345
BTW, the login window is implemented using PyXBMCt: https://github.com/romanvm/ex.ua.alterna..._window.py
Don't mind Russian text labels - object names are self-explanatory.


Hello,
Thank you so much.
My problem is solved.
Thanks
Reply
#92
(2014-06-15, 13:27)el_Paraguayo Wrote: Quick update - this is what I've managed to do with your code:
https://www.youtube.com/watch?v=SN31SAIERhs

Quite happy with this!

Thanks. Looks interesting, though I'm not a football fan myself.Smile
Reply
#93
I'm glad to announce that PyXBMCt module has been accepted to XBMC official Gotham repo. So now you can simply use:
Code:
<requires>
...
<import addon="script.module.pyxbmct" version="1.1.2"/>
...
</requires>
in your addon.xml.
Reply
#94
(2014-06-24, 21:22)Roman_V_M Wrote: I'm glad to announce that PyXBMCt module has been accepted to XBMC official Gotham repo. So now you can simply use:
Code:
<requires>
...
<import addon="script.module.pyxbmct" version="1.1.2"/>
...
</requires>
in your addon.xml.


Its good news. Hearty congratulation.
Thanks
Reply
#95
Yeah great news.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#96
Hi,
I'm having a hard time with modal dialogs in what is probably an unusual situation. To summarize, I'm having difficulty getting a modal window to appear in front of another modal window.
The details are that I have a python script that runs from an addon settings page using:
Code:
<setting default="" id="onStartup_test" label="32009" type="action" action="RunScript($CWD/resources/lib/tester.py, onStartup)" />

In the code from 'tester.py', if I create a normal dialog box using:
Code:
dialog = xbmcgui.Dialog()
dialog.ok(__language__(32049), msg)

It appears in front of the settings page dialog and all is well. But this dialog is too small to display the amount of text I need to show. So I first tried using xbmcgui and then pyXBMCt to create larger window dialog boxes, but when calling .domodal they remain hidden behind the settings dialog box. To test, I used the code from the first page of this thread:

Code:
from pyxbmct.addonwindow import *

class MyWindow(AddonDialogWindow):

    def __init__(self, title=''):
        # You need to call base class' constructor.
        super(MyWindow, self).__init__(title)
        # Set the window width, height and the grid resolution: 2 rows, 3 columns.
        self.setGeometry(350, 150, 2, 3)
        # Create a text label.
        label = Label('This is a PyXBMCt window.', alignment=ALIGN_CENTER)
        # Place the label on the window grid.
        self.placeControl(label, 0, 0, columnspan=3)
        # Create a button.
        button = Button('Close')
        # Place the button on the window grid.
        self.placeControl(button, 1, 1)
        # Set initial focus on the button.
        self.setFocus(button)
        # Connect the button to a function.
        self.connect(button, self.close)
        # Connect a key action to a function.
        self.connect(ACTION_NAV_BACK, self.close)


# Create a window instance.
window = MyWindow('Hello, World!')
# Show the created window.
window.doModal()

Doing this, the modal window is created and I can see using the debugger that the code runs successfully, but in the GUI, the window is behind the settings dialog.

One small note, if you try to reproduce this - the code in pyxbmct/addonwindow.py needs to have the name of the addon hardcoded [_addon = xbmcaddon.Addon('myaddon')] because it is being called from a script outside the addon extension point. This does not cause me issues and in the actual code, I import the addon's own default.py and use classes and methods from there.

If you want to see the full situation, the project on GitHub is here: https://github.com/KenV99/service.xbmc.c...llincluded I don't have the failed attempt currently in the file tester.py, but can add it if you need to see how I am calling it...

Thanks for this useful framework!
Reply
#97
Unfortunately, as far as I know, there is no way to control the priority of windows based on xbmcgui Python classes. You can either try to use XML-based controls in your script and play with <zorder> property, or set the coordinates of an AddonDialorWindow instance explicitly to move it to a visible area, not covered by Settings dialog.
Reply
#98
Thanks. Using the XML based dialog worked, but I have to say the documentation for using it from a script is horrible. Once I get a full handle on it, I'll try to revise the wiki.
Reply
#99
Hi everyone
I want add new ControlList in window myvideonav.xml (id = 10025) with PyXBMCt but I dont know how do I do.
Is it possible?
Image
Video is defined by skin (xml)
Categories is defined by addon (python).
thanks!
Reply
2 luka

I'm not sure what you are trying to do. Please provide more details along with code snippets.
Reply
Roman,

I want to display a text box and a button on top right corner of the screen while the media is playing. Could you give me some pointer please? Do you think I need to the GUI to the thread in order to do so?
Reply
(2014-10-30, 21:13)Gameforus Wrote: Roman,

I want to display a text box and a button on top right corner of the screen while the media is playing. Could you give me some pointer please? Do you think I need to the GUI to the thread in order to do so?

I don't quite understand your question (the last part about "thread"), but yes, an AddonDialogWindow instance can be opened over full-screen video, and you can set coordinates explicitly. You can use the example in the 1-st post, it includes a text label and a button.
Reply
Quote: an AddonDialogWindow instance can be opened over full-screen video, and you can set coordinates explicitly. You can use the example in the 1-st post, it includes a text label and a button.

so, AddonDialogWindow instance can be opened over fullscreen video, but does it freeze the video or the video still playing on the background?
Reply
(2014-10-31, 22:27)Gameforus Wrote: so, AddonDialogWindow instance can be opened over fullscreen video, but does it freeze the video or the video still playing on the background?

No, it won't affect video playback, unless you add some specific code for that purpose into your addon.
Reply
Roman_v_M,

Could you take a look at this code below and tell me why the textbox don't show up?

Code:
import pyxbmct.addonwindow as pyxbmct
# Create a window instance.
window = pyxbmct.AddonDialogWindow('')
# Set the window width, height and the grid resolution: 1 rows, 3 columns.  
window.setGeometry(350, 100, 1, 3)
textbox = pyxbmct.TextBox()
textbox.setText('the text goes here')
window.placeControl(textbox, 0, 0)
window.doModal()
del window
Reply
  • 1
  • 5
  • 6
  • 7(current)
  • 8
  • 9
  • 27

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