how to generate custom layout and interact with it from python script

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
themarty Offline
Junior Member
Posts: 10
Joined: Mar 2012
Reputation: 0
Post: #1
Just need a kick in the right direction here.

I'm quite new to making addons, but i've succesfully created 2 simple ones so far. Both do nothing more than generating lists of items and some functionality behind it (like generating a new list or play an audio stream).
What i'd like to do now is create an addon with a more complex layout then just a list. Something that look like this:

http://wiki.xbmc.org/images/a/a0/Library...t.WSCR.jpg

A frame on the right with a list; a visual/video in the top-left and information about the video in the bottom-left. When i try to find information how to do this i only find pages about skinning, but it is unclear to me how i create the skin/template/layout and then interact with it from my python script. Can someone give me a kick in the right direction?
find quote
Bstrdsmkr Offline
Posting Freak
Posts: 803
Joined: Oct 2010
Reputation: 17
Post: #2
Creating custom layouts in addons is kind of a pain. You have to either come up with a generic enough look that it doesn't look out of place, or create a version for every skin.

You're finding everything about skins because skins are essentially addons that display information from other addons. Here's the python information you're looking for: http://mirrors.xbmc.org/docs/python-docs...tml#Window

You can create a window or dialog in python from scratch by creating a window/dialog object, then creating controls (such as buttons), then adding the control objects to the window object. Once it's assembled, call the window object's .show() method to display it on screen.

You can also create a base window in xml, then manipulate it in python by creating a WindowXML (or a WindowXMLDialog) object and passing in the name or your xml file. This way, if a skin author wants, they can override your xml with their own version that looks good with their skin. See the skinning manual: http://wiki.xbmc.org/index.php?title=XBM..._are_found for how that works

The difference between a Window and a Dialog, is that Windows clear everything off screen before being shown, so if you didn't add it to your window, it's not there. A Dialog is drawn overtop of what's already onscreen.
find quote