• 1
  • 8
  • 9
  • 10(current)
  • 11
  • 12
  • 13
WindowXML GUI Toolkit (replaces GUIBuilder for XBMC python scripts for GUI coding)
I haven't tried.

1. If any of the controls with id's 50-59 are not type="list", then try wrapping the individual control in a group.
2. then either setVisible(True) the list you want or the group. obviously setVisble(False) the other one.
3. you could have control 51 <visible>!Control.IsVisible(50)</visible> then just set control 50 hidden or visible as long as 50 is a type="list" then 51 would not need to be in a group even if it was type="panel"
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
Hi everyone,

Is there any way of changing the imagepath property of a multiimage control from a script? There's no mention of the multiimage control in the updated xbmcgui docs donno posted (which includes the new WindowXML classes).

I've tried guessing a few method names (setPath, setImagePath, setImage etc.) but had no luck so far, and I've looked through the SVN on SourceForge to try & find the relevant C++ files (winxml.cpp or windowxml.cpp?) but not managed to find anything - SourceForge's search tool didn't return anything either. I know a bit of C++ but have trouble understanding something as complex as XBMC, so I'm probably just looking in the wrong place :p

Thanks in advance for any help you can give!
JC
Reply
The multiimage control is not a native python control, so no methods are available for it.

I use a skin setting.

In the script:
Code:
xbmc.executebuiltin( "Skin.SetString(AMT-chooser-thumbfolder,%s)" % ( os.path.join( self.base_path, choice, "media", "thumbs" ), ) )

In the xml file:
Code:
<control type="multiimage">
  <posx>200</posx>
  <posy>40</posy>
  <width>241</width>
  <height>135</height>
  <info>Skin.String(AMT-chooser-thumbfolder)</info>
  <timeperimage>2000</timeperimage>
  <fadetime>500</fadetime>
  <visible>!Control.IsVisible(504)</visible>
  <animation effect="fade" time="200">VisibleChange</animation>
  <aspectratio>keep</aspectratio>
</control>
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
Thanks! That's got me a bit closer, but I'm still having trouble.

If I use SetString to change a skin setting, then try & create a window from the same script, the multiimage controls aren't displayed (or they're displayed with no images loaded).

I know the SetString function worked, as I can read the string using a label control. If I comment out the line that sets the string & run the script again, the multiimage displays as expected (using the string value set from running the script the first time).

I've tried setting the string from the class's OnInit and __init__ functions, and in the main script before the window object is created, but still can't get it to work.

Any thoughts? Thanks Smile
Reply
Did you use the <info> tag or the <imagePath> tag?

Look at my example, using the <imagePath> got me at first.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
No, I used the <info> tag (tried <imagePath> as well just to be sure).

When I set the string directly before creating the window, the images don't show. If I exit the script, comment out the line that calls the SetString function, then run the script again, the images display using the path I set the first time.

I can display the value of the string using the <info> tag of a label control regardless of when/where I called the SetString function, so I'm pretty stuck as to where the problem is.
Reply
how old is your XBMC build? I set it from onInit() the first time then change it after the window is open. I also did a quick test from init() and it worked.

Post the xml and the revelant python code.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
Sorry, I made a mistake in my earlier posts. After setting the string, I have to completely restart XBMC before the multiimage control will show. Calling the SetString function (even to set the string to the same value it already had) results in the multiimages not being displayed.

I've tried the script with a few different skins & had the same problem with each. Is there something wrong with my XBMC build? I'm using T3CH 2007-07-16 rev9578.

I've been using the following files to try & isolate the problem (trying to keep them as simple as possible):

In multiimage_test.py:
Code:
import xbmc, xbmcgui

xbmc.executebuiltin("Skin.SetString(multiimage-test, Q:\\test)")

class win(xbmcgui.WindowXML):
    pass

w = win("customTest.xml", "Q:\skin")
w.doModal()
del w

In customTest.xml:
Code:
<window id="5599">
    <controls>
        <control type="label" id="101">
            <info>Skin.String(multiimage-test)</info>
        </control>
        
        <control type="multiimage" id="102">
            <posx>60</posx>
            <posy>200</posy>
            <width>130</width>
            <height>98</height>
            <info>Skin.String(multiimage-test)</info>
        </control>
    </controls>
</window>

After running the script, the label text is set to the value of multiimage-test (Q:\test), but no images are displayed. If I comment out the xbmc.executebuiltin line in the script, then restart XBMC and run the script again, the label shows the value set before and the multiimage displays, showing the correct images.

The problem exists with the same XBMC build on my Xbox and using the XBMC_PC program.
Reply
Code:
w = win("customTest.xml", "Q:\skin")

escape the backslash, not your problem since the label shows though.


Get rid of the space after the comma shoulod fix it.
Code:
xbmc.executebuiltin("Skin.SetString(multiimage-test, Q:\\test)")
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
Excellent! Thanks a lot for your help. The fallback path was escaped properly in the script I'm working on, I just missed it in the test script. The problem was the space in the built-in function call. All working fine now Smile
Reply
Good, what script are you working on?
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
Nuka1195 Wrote:I haven't tried.

1. If any of the controls with id's 50-59 are not type="list", then try wrapping the individual control in a group.
2. then either setVisible(True) the list you want or the group. obviously setVisble(False) the other one.
3. you could have control 51 <visible>!Control.IsVisible(50)</visible> then just set control 50 hidden or visible as long as 50 is a type="list" then 51 would not need to be in a group even if it was type="panel"

Well, I must be doing something wrong. I have to controls of type="list" and they have ID 50 and 51. I added the <visible>!Control.IsVisible(50)</visible> to the control 51, but doesn't work. When I hide 50, 51 won't show.

the code in the script is in the onInit:
Code:
if not self.initialised:
self.getControl(50).setVisible(False)

and the XML looks like this: http://pastebin.com/m3e7d8adf

So I am lost. I hope you can help me out?
Reply
then I would say id's 50-59 can only be controlled by XBMC.

Maybe Donno can enlighten us.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
I'm working on an alternative home screen/launcher menu. I might have to make a separate skin for it depending on how complex it gets. It probably won't be of any use for most people, so I doubt I'll make it public, but you never know Big Grin It's still a very early work in progress, but I'm pleased with how it's going so far - WindowXML's made development so much easier, I haven't written an XBMC script for a while & the GUI situation has really improved!

I share a house with quite a few friends. We've got our combined DVD collection ripped & stored on a network server (almost 2TB of XviD-encoded movies & TV series) and a few live TV channels being streamed over the network too. Between us we've got 6 xboxes, and XBMC is the main way we watch TV. We've been using it over 3 years now & have a pretty good feel for which features we use the most - I'm aiming to make just those features quicker to access, which is why it'll probably be useless for most users.

The menu's been inspired by a few things - mostly by the simplicity of the Wii menu and the PM3 style/colour scheme. Everything's loaded from XML at runtime, so it's easy to add, remove or reorganise channels. Navigation works over a number of pages, each page displaying 12 channels at a time, which can be accessed by browsing through the menu or entering a 3-digit channel number using the Xbox remote control (with a bit of keymap.xml tweaking). Highlighting a channel changes the menu background & causes the selected channel button to cycle through a set of images (the result of my multiimage headaches!)

"Channels" can represent many different features of XBMC - a script, a direct file/stream link, access to a network share using the video/music browser, an XBMC window (e.g. weather) or an XBE file. I'm going to add buttons for Settings & the power menu to the bar at the bottom of the screen but haven't got round to it yet.

Like I said, it's not very mature yet - the UI still needs work & there's absolutely no error checking, but here's what it looks like so far:
Image
Reply
I love that idea, and thinking about it a little if end users could customise channels through a context menu (maybe a dialog lets them chose what it points too and then a thumbnail) then anyone could use the skin and everyone could have it layed out however they liked.

to be honest I'm no coder (yet) so I'm unsure how difficult this would be, but the potential for this idea is massive I think.
Reply
  • 1
  • 8
  • 9
  • 10(current)
  • 11
  • 12
  • 13

Logout Mark Read Team Forum Stats Members Help
WindowXML GUI Toolkit (replaces GUIBuilder for XBMC python scripts for GUI coding)0