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
asg Offline
Member
Posts: 80
Joined: Nov 2005
Reputation: 0
Post: #11
Hi donno,

i´ve just compiled the branched windowxml to test it. Could you post a more recent python example, so i could play with it a bit?

Thanks in advance
asciii
find quote
donno Offline
Team-XBMC Python Developer
Posts: 131
Joined: Jan 2005
Reputation: 0
Location: Australia
Post: #12
After much hard work I have finally got the lists/multi views to work.

This means instead of just having one list/type, you can add items to the 'window's list' and have it shared over up to 10 different lists.
ID 50 to 59 (same as Videos/Music/Pictures/Program windows in skinning Smile.
So you can have Wide Icons view/ List, List 2 type stuff for your own script.

ID 2 is reserved for the View button so if you don't want the view button or to use multi views simply do not use id 2, 3,4, 12 or 50-59 for any controls.
ID 2 is the View Button, 3 is the Sort Button, 4 is the Asc/Dsc button, 12 is
the number of objects label, 50-59 are the lists.

So if you have View button and lists with ids 50 to 59 Smile the following is of intrest
WindowXML Methods
refreshList() -- Updates the Windows Lists (any new items will be shown once this command is ran.

addItem(item[,refreshList]) -- Add a new item to windows list.
refreshList is 1 (true) by default what this means is
If TRUE it will perform a refresh/sync after every add so the lists will be up to date.
If FALSE then it won't perform a update of the lists so anything u added won't be seen until u run refreshList()

Reason for this refresh stuff is say u want to add a lot of entries to a list you may want to wait till they all were added to the internal list before showing them on the screen instead of showing them after each is added.
---------------------------------


I need to get "clearList() -- Clear the Window List" to work

Future) The ListItem may need to be improved so it can set stuff as 'album,artist,title' and such so info labels in the lists would work nicely Smile

Sorry if this post is confusing it was Smile 12am and im just trying to get down as much as I can think of.


Note) I need to fix the py docs for the window xml stuff Smile
I committed the WindowXMLExample script as a zip into the scripts folder in the branch
Download a XBMC_PC exe here If this link is broken it could mean threes a new version Smile or windowxml is completed in trunk.

TODO)
  • Fallback path rendering correctly and using fallbackpath\media [this needs to be done to make it trunk ready]
  • Open up more controls to python [this can always been done once it is in the trunk no hurry)
  • Extend ListItem [ Again its whenever]
  • Extend Script Window Functionality
  • Clean up file cosemetics (tabs/spaces)

Maybe its best try to read it then ask me little questions about it

** 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
asg Offline
Member
Posts: 80
Joined: Nov 2005
Reputation: 0
Post: #13
Very nice .. thanks donno! Is there already a way to use onControl events from the ListItems? Maybe i am just too dumb/blind ? Smile
find quote
stanley87 Offline
Skilled Python Coder
Posts: 555
Joined: Sep 2006
Reputation: 2
Location: Chch, New Zealand
Post: #14
def onClick(self, controlID):
if (controlID == 7):
xbmcgui.Dialog().ok(__title__ + ": About","Example Script coded by Donno Big Grin","WindowXML Class coded by Donno","With help from Spiff Smile")
find quote
stanley87 Offline
Skilled Python Coder
Posts: 555
Joined: Sep 2006
Reputation: 2
Location: Chch, New Zealand
Post: #15
oops, just re-read your message, good point.
find quote
donno Offline
Team-XBMC Python Developer
Posts: 131
Joined: Jan 2005
Reputation: 0
Location: Australia
Post: #16
WindowXML Progress Update
Thanks to JMarshal, I was able to fix the problems remaining in the WindowXML Code.
So now you can navigate to the list if you change the view. Fallback for xml and media also works now.
The only thing off the top of my head I can see missing is the WindowXMLDialog Smile to make your own DialogOK etc.
Ill try to code WindowXMLDialog ASAP, unless there is anything other critical thing that is required, I think that makes it close for going in the trunk and public use.

Just to let you know I have a few other little improvements I want to do with the “Scripts window”, so stay tuned.

** 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
Asteron Offline
"Skilled" Python Coder
Posts: 933
Joined: Feb 2004
Reputation: 0
Post: #17
Can you allow being able to specify whether it is a window/dialog in the XML? That would definitely give skinners more flexibility.

How does the xml parsing compare to guibuilder?
find quote
asg Offline
Member
Posts: 80
Joined: Nov 2005
Reputation: 0
Post: #18
How to use getSelectedItem/Position from the Listitem? Is this implemented yet?

cheerz
asciii
find quote
Nuka1195 Online
Skilled Python Coder
Posts: 3,917
Joined: Dec 2004
Reputation: 17
Post: #19
guibuilder, uses the same functions that are in XBMC translated to python, of course WindowXML will be faster and better on memory.

Why do you ask asteron?

ascii you should read the python docs they clearly explain it.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
Asteron Offline
"Skilled" Python Coder
Posts: 933
Joined: Feb 2004
Reputation: 0
Post: #20
Well I was wondering if Donno had some quantitative numbers. I asked "How does it compare?" and not "Is it better?"

I was worried that XML parsing would be similar since the xml.minidom module is from the python.dll which is written in C and I havent done a profile of your code to identify where it spends most of its time Smile

But yeah you're probably right in that the initial time load time is probably a lot less than the iterating over the nodes so the savings should be very significant.
(This post was last modified: 2007-03-12 22:03 by Asteron.)
find quote
Post Reply