WindowXML GUI Toolkit (replaces GUIBuilder for XBMC python scripts for GUI coding)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #46
#1 is fixed in SVN, by JMarshall Smile

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
matthuisman Offline
Skilled Python Coder
Posts: 597
Joined: Sep 2006
Reputation: 4
Location: Chch, New Zealand
Big Grin   
Post: #47
YAH! this was worrying me.

now if donno just got on2 that problem with winxmldialog fallbackpath not working, i will be one happy camper!! And maybe added the removelistitem feature, this would be perfection! Iv learnt to live with the no set thumbnail images. I just reset the list and add all the items with the new icons.
find quote
matthuisman Offline
Skilled Python Coder
Posts: 597
Joined: Sep 2006
Reputation: 4
Location: Chch, New Zealand
Post: #48
asciii Wrote:mixing windowxml style list and old traditional listitems works fine here. thanks for this "simple" solution stanley Smile
a function to reformat the list (label,label2..) without just clear and rebuild the list would be great. alter single list items would also be nice.
great work. thanks
asciii

Yeh, donno said he might be able to implement a listremoveitem command which would be very handy for my script as, when emails are deleted, they need to be removed from the email list, and at present, i have to reset the list and then rebuild it.
find quote
donno Offline
Team-XBMC Python Developer
Posts: 130
Joined: Jan 2005
Reputation: 0
Location: Australia
Post: #49
Sorry for forgetting, thou I swear I checked this 2 days ago and last post was stan, usually i don't bother replying here as I always catch stan on irc.
Time to answer some questions

1) OnClick getting fired by stuff like the selecItem
This is now fixed, the problem was i removed code that limited the event to be raised only by controllist (if it was aselect item), or if the contrl was a button or checkmark). However i didn't expleciity set it for the button and checkmark this way stuff like the togglebutton (even thou it doesn't have a python contro equivlent, you can still detect if it got a onClick.
Fixed in SVN

2) Media fallback path does not work in winxml Dialog windows BY Stanley
I have got no idea why that not working, we even look at the code and its fine it should execute the same render function as Dialog
Fixed in SVN

3) Can not set thumbnails on list items.
Well you can set thumbnails on list items, how ever due to limitation bug in the coding of the getListItem, i was unable to get it to pass the real list item so instead, the a 'new list item is created' with the info from the real one, so therefore doing set on it has no effect on the real item that is in the list.
This was done to fix another problem and this was the solution so sorry about that. getListItem can be used for gets fine (just not sets).

Still Broken I won't fix this one as I wrote it the way it currently is.

Nuka1195: self.getControl(4).addItem("") SHOULDN"T work, as control id 4 is reserved for the sort asc button.
Ids 3 and 4 are reserved for the sort and sort asc toggle button, and shouldn't be used at the moment. its not implemented but I left it in just incase.
That being said to clarify you SHOULD NOT use ID 2,12, 50-59 for anything else other then View Button, Label containing number Objects in list, and the lists for multi view types.

Also Nuka. stanley and I decided against fallback\skins\skinname\media in favor of fallback\skins\media (this is how the WindowXML works currently), no idea why the dialog version isn't.

Added:
removeItem to WindowXML, used to remove an item in the Window Lists.
Changed:
WindowXMLDialog is now based on WindowXML (more so), it now has the 'WindowLists' and the ablity to use lists 50-59 as ONE (and supports the view button) so you can have multi view types. on a Dialog Smile 'well window with a transparent background'

Might be a good idea to update the pydocs on XBMCScripts.
For now XBMCGUI Python Doc at time of writting it was based on revision 8466 of XBMC.

** Team XBMC Tester** XBMC 4 ever

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]
(This post was last modified: 2007-04-11 13:48 by donno.)
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #50
Quote:self.getControl(4).addItem("") SHOULDN"T work
That's fine, but if i assign control(4) to another variable it works, so your saying self.getControl(44).addItem("") should work?

Quote:stanley and I decided against fallback\skins\skinname\media in favor of fallback\skins\media
This needs to be reconsidered, I have a patch that works (except for dialogs as it currently doesn't work either) It would be benificial to me to have the media folder inside the skinname folder. I'm sure if i tell you why, you'll argue Smile

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
matthuisman Offline
Skilled Python Coder
Posts: 597
Joined: Sep 2006
Reputation: 4
Location: Chch, New Zealand
Post: #51
Media fallback on dialogs now fixed in SVN - yah for donno!
Also, removeitem has been added :-D

Plus, the media folder is fine-and if you want to have a media folder for each skin, easier enought to do like you said and just input the fallback path as script/skins/media etc

:-D
find quote
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #52
no stanley, i need multiple media folders, so no need to keep arguing.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
donno Offline
Team-XBMC Python Developer
Posts: 130
Joined: Jan 2005
Reputation: 0
Location: Australia
Post: #53
Smile Got locked out the forums because of your message, tried logging to reply but it locked me out for an hour, then when got in i forgot why.

Nuka1195 Wrote:That's fine, but if i assign control(4) to another variable it works, so your saying self.getControl(44).addItem("") should work?

Tes that will work providing getControl ist a list (pretty sure panels and that won't work as they don't get converted to a ControlList),


The only reason i can see for having multiply media folders
for each skin is if you want to have your own extra imagines deisnged for that skin. and of coruse Smile want to use the same xml. stanley87 has pointed out to me that, to avoid conflicts changing the name of the textures to something like dbackground.png for the default skin (this way it also doesn't conflict with any image in the skin path which is probley a good thing due to your feature the 'forceFallback'. Because im 99% with regards to media the current skin or memory/xpr is checked first than the fallback path media.

Like wise you could have like amt-banner-mc360.png and whack that in the skins. However if you must there is on other reason why this 'just change the name is better and leaving media in skins\ rather than PER SKIN.

Which is just if you have generic images that should be used for all the skins like a the title banner for the script that is tied to NO skin.

** Team XBMC Tester** XBMC 4 ever

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
matthuisman Offline
Skilled Python Coder
Posts: 597
Joined: Sep 2006
Reputation: 4
Location: Chch, New Zealand
Post: #54
donno Wrote:Smile Got locked out the forums because of your message, tried logging to reply but it locked me out for an hour, then when got in i forgot why.



Tes that will work providing getControl ist a list (pretty sure panels and that won't work as they don't get converted to a ControlList),


The only reason i can see for having multiply media folders
for each skin is if you want to have your own extra imagines deisnged for that skin. and of coruse Smile want to use the same xml. stanley87 has pointed out to me that, to avoid conflicts changing the name of the textures to something like dbackground.png for the default skin (this way it also doesn't conflict with any image in the skin path which is probley a good thing due to your feature the 'forceFallback'. Because im 99% with regards to media the current skin or memory/xpr is checked first than the fallback path media.

Like wise you could have like amt-banner-mc360.png and whack that in the skins. However if you must there is on other reason why this 'just change the name is better and leaving media in skins\ rather than PER SKIN.

Which is just if you have generic images that should be used for all the skins like a the title banner for the script that is tied to NO skin.



for multiple skins i would just name it eg: default_background.png
: mc360_background.png

have them all in the one folder and just change the xml's to use these.
find quote
matthuisman Offline
Skilled Python Coder
Posts: 597
Joined: Sep 2006
Reputation: 4
Location: Chch, New Zealand
Big Grin   
Post: #55
Ok,

I have been helping Donno out and testing certain things and in the progress a few bugs have been found and most of them fixed.

There is a known problem that when using non-id 50 control lists
The problem is: You can not getControl of the list twice!
eg: self.list = self.getControl(67) where 67 is the id if your list.

This is a problem as these are set up usually in _oninit_ and _oninit_ is called everytime the window is opened (eg, when switching back from second window). So, this will crash xbmc. As a result we have found a way around this. In the _init_ of windows define a variable to 0 - (eg. self.initon = 0), then in your _oninit_ use if self.initon == 0:, the in this if statement, get all your controls etc. and dont forget then to set: self.initon = 1. Hence, when returning from a window, it will not try to getControl's again and as a result, script wont crash:This also enables the scripter to set controls based on if its the first time the window has been opened etc.
Note: You have to make sure not to use getControl for the list anywhere else in the script! just use the variable you assign to it: eg. self.list = self.getControl(60), then just use self.list in the rest of the script.
Example of code:

Code:
def __init__(self,strXMLname, strFallbackPath,strDefaultName,bforeFallback=0):
        xbmcgui.lock()
        self.initon = 0
        
    def onInit(self):
        if self.initon == 0:
            self.list = self.getControl(50)
            self.initon = 1:
            print "This is the first time you have opened this window"
        else:
           print "This is NOT the first time you have opened this window"
        xbmcgui.unlock()

This does not to be used if list with ids 50 are being used, as you then dont need to use the getControl command.

Another bug that has been fixed is if a Textbox had only one page, and page up or down was pressed on the spin control, xbmc would crash - this is fixed in the latest xbmc svn rev.

PS: The problem above does not occur with WindowxmlDialog, as when returning from a winxmldialog to a window, _oninit_ is not called again, but still probably best to keep it the way above and not use self.getControl twice in your script.

Hope this helps some people.

Currently, Donno is trying to fix the media fallback path on textures for spin controls not working. So hope this is fixed soon.

Thanks,
Stanley87
find quote
matthuisman Offline
Skilled Python Coder
Posts: 597
Joined: Sep 2006
Reputation: 4
Location: Chch, New Zealand
Post: #56
PS: may i also just say,
that xbmc-scripting SVN team are king of all scripting!

http://xbmc-scripting.googlecode.com/svn/trunk/
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,669
Joined: Oct 2003
Reputation: 169
Post: #57
Why on earth does it crash if you GetControl() twice? Clearly there's a bug there. Will chat with Donno next time he's around.

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
Nuka1195 Offline
Skilled Python Coder
Posts: 3,910
Joined: Dec 2004
Reputation: 18
Post: #58
XBMC Lyrics doesn't crash coming back from settings. It uses lists id=110 and 120

edit: nm, Lyrics is a dialog.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
(This post was last modified: 2007-04-13 04:22 by Nuka1195.)
find quote
matthuisman Offline
Skilled Python Coder
Posts: 597
Joined: Sep 2006
Reputation: 4
Location: Chch, New Zealand
Post: #59
jmarshall Wrote:Why on earth does it crash if you GetControl() twice? Clearly there's a bug there. Will chat with Donno next time he's around.


Yup, there is. Donno was looking into it. With yours and his head together, im sure it will be solved very soon.
Then all i need is the media fallback path issue on spin controls and scroll bars to work and I will be a very happy camper!
find quote
matthuisman Offline
Skilled Python Coder
Posts: 597
Joined: Sep 2006
Reputation: 4
Location: Chch, New Zealand
Post: #60
Nuka1195 Wrote:XBMC Lyrics doesn't crash coming back from settings. It uses lists id=110 and 120

edit: nm, Lyrics is a dialog.

dam :-(, your the first to have a fully functional script using winxml!, i was hoping i would be first. But i can still have mine to be the first with multiple winxml windows and dialogs.
The Race Is on!
find quote
Post Reply