• 1
  • 23
  • 24
  • 25
  • 26
  • 27(current)
Release PyXBMCt: a Python framework for simple creating UI for XBMC addons
Hi Roman,

hope you're doing well. I've been using your add-on for quite a while in my own add-ons and I'm very grateful for all the work and support you put into it.

There's one little thing which has been bothering me and I haven't found a way to work around it:
When I place a RadioButton or a List control in my dialog, there's always a thin line at the top and at the bottom of each radio button and each list item which I'd prefer to be not visible. I assumed it has something to do with the textures that are used. However, when I looked at the textures you supplied, I didn't see those lines at the top or at the bottom.

Can you give any advice, how I could get rid of these presumed "artefacts"?

Thank you in advance.
Reply
One more question which does not particularly go to Roman but to other users of his great add-on:

Any advice how to handle list items which contain text that should be arranged in columns (like in a table) other than using a monospaced font?
I want to display a list of received or placed phone calls. So each list item contains a date followed by a name or number and the duration of the call at the end.
However, with the default font, it looks all messed up. Using a monospaced font is a practical workaround, but maybe there's a better way to format my list.

BTW, the lines / line items must be selectable. That's why I don't want to use separate List controls for each column.
Reply
(2024-01-02, 17:35)Spirou Wrote: However, when I looked at the textures you supplied, I didn't see those lines at the top or at the bottom.

MenuItemNF.png from Estuary skin that is used both in RadionButton and List does have thin 1-pixel edges at the top and bottom with #2A2A2A color.
Reply
Thank you, Roman, for the prompt reply.

My eyes are getting old Sad I definitely failed to notice the thin line in your textures. So I will replace these with my own textures and hope this will solve my issue.

Update: Tested with my own texture file and it works Smile Just out of curiosity: What was the reason for having these lines in your texture in the first place?
Reply
I have zero artistic talents so all textures were borrowed from Kodi skin assets.
Reply
Not sure if this a bug in the add-on itself or in the underlying Kodi code.

If I place a background image (pyxmbct.Image()) behind a List (pyxbmct.List()) which spans over multiple rows and columns, I always notice that the vertical size of the List doesn't match the vertical size of the background image. I have to use different values of rowspan for each control and fiddle with the _space value In the List control to make it match. To me it seems that the vertical size of the List is wrongly calculated when transforming from grid to absolute coordinates.

Can you check, please?
Reply
The code that calculates Controls placement is the same, no Control has special treatment. You can use pad_x/pad_y arguments of placeControl() method to adjust visible Control's size.
Reply
Seems that Kodi crops out entire lines/rows if they don't fit in the frame 100%. So you can oversize the dimension of the List control (compared to the background image) or adjust the spacing between the rows to adjust to the background frame. PAD_X/PAD_Y, as I understand it, would add additional space around the visible control (inside the frame) and actually downsize the control.

I will play with the settings to see what gives the best result. 

Thanks for your help.
Reply
(2024-01-05, 16:30)Spirou Wrote: PAD_X/PAD_Y, as I understand it, would add additional space around the visible control (inside the frame) and actually downsize the control.

Not quite. As stated in the ducumentation, negative values are also accepted that allow to increase Control's size.
Reply
Hi there!

I'm trying to learn some coding while playing with kodi. Thanks Roman for creating this framework that helps develop my UI.
I have managed to get an addon working, but now I want to create a window with an auto-updatable label that shows the results of another process. The window should be visible and auto-update regularly (ex every second) until it is closed by the user by pressing the close button or using the Back key.
The window is pretty standard:
Quote:class StatusWindow(pyxbmct.AddonDialogWindow):
    def __init__(self, title=''):
        """Class constructor"""
        # Call the base class' constructor.
        super(StatusWindow, self).__init__(title)
        # Set width, height and the grid parameters
        self.setGeometry(640, 480, 2, 1)
        # 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"""

        # Text label
        self.label = pyxbmct.Label('Status:', alignment=pyxbmct.addonwindow.ALIGN_LEFT)
        self.placeControl(self.label, 0, 0)

        # Close button
        self.close_button = pyxbmct.Button('Close')
        self.placeControl(self.close_button, 1, 0)
        # Connect close button
        self.connect(self.close_button, self.close)


    def set_navigation(self):
        """Set up keyboard/remote navigation between controls."""
        # Set initial focus.
        self.setFocus(self.close_button)
My problem is, if I show it with .doModal(), I can't update the label using setLabel later (ie, whatever the label is set to after I create an instance of the StatusWindow is what remains, even if I use setLabel later).

If I call it with .show() and add a wait, I can use setLabel but I can't close the window using the close button or the Back key.

This means that I can currently either have a window that the user can close, or a window that auto-updates, but not both!

I'm sure that I am not understanding some basic functionality here, but I would appreciate if someone can point me in the right direction!
Reply
doModal() is blocking the current thread so you cannot do anything in it while your window is open and its event loop is running. You need to updat your label from another thread.
Reply
Thanks Roman!
I'll look into that.
Reply
  • 1
  • 23
  • 24
  • 25
  • 26
  • 27(current)

Logout Mark Read Team Forum Stats Members Help
PyXBMCt: a Python framework for simple creating UI for XBMC addons4
This forum uses Lukasz Tkacz MyBB addons.