XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Plugin/Script (Python) Development

Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only!
Not for posting feature requests, bugs, or end-user support requests!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-04-21, 01:43   #1
zilvershadow
Senior Member
 
Join Date: Oct 2003
Location: Netherlands
Posts: 136
zilvershadow is on a distinguished road
Default

i have a list of items:

item 1
item 2
item 3

but i want them labeled:

item 1 (www.address1.com)
item 2 (www.address2.com)
item 3 (www.address3.com)

(this is must not be visible in the screen)

when u select the item the address should appear in a dialog for example (test fase)

who could help me, please?

thanks
__________________
greets,

zilvershadow
designer of the kmlbrowser script.
zilvershadow is offline   Reply With Quote
Old 2004-04-21, 06:34   #2
madtw
Senior Member
 
Join Date: Mar 2004
Posts: 174
madtw is on a distinguished road
Default

create two lists: one to store the list labels and one to store the equivalent value. pass the label list to the list control when creating the gui. when the user selects a value you get an index returned to you. lookup the entry in the value list using the index returned to get the actual web address. for example:

Quote:
labels = [ 'item 1', 'item 2', 'item 3' ]
values = ['www.address1.com', 'www.address2.com', 'www.address3.com' ]

dlg = xbmcgui.dialog()
selected = dlg.select('pick a value',labels)
print 'you picked %s' % values[selected]
madtw is offline   Reply With Quote
Old 2004-04-21, 14:42   #3
zilvershadow
Senior Member
 
Join Date: Oct 2003
Location: Netherlands
Posts: 136
zilvershadow is on a distinguished road
Default

i did it now with xbmcgui.controllist: getselectedposition() and it works.

thanks anyways

now i would like to sort the list in various ways just like in my music. i want a button that can do several actions to the list.

could you tell me how to do that?

(i'm learning python, it's all new to me but i like it very much and i'm writing a nice script with some very nice results.)

in a few days i'll show you my results.

thanks
__________________
greets,

zilvershadow
designer of the kmlbrowser script.
zilvershadow is offline   Reply With Quote
Old 2004-04-22, 06:55   #4
madtw
Senior Member
 
Join Date: Mar 2004
Posts: 174
madtw is on a distinguished road
Default

python list objects have a sort() method that takes a comparison function as an argument. you can do whatever custom comparison you need to do in that function. just have a look at the tutorials and reference information at http://python.org/doc for more information.
madtw is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ControlList fultotop Plugin/Script (Python) Development 1 2006-06-08 23:39
ControlList...Scroll? tartag Plugin/Script (Python) Help and Support 8 2005-11-29 19:59
Controllist entries Nuka1195 Plugin/Script (Python) Development 5 2005-10-20 11:01
Xbmcgui controllist() hibaby XBMC for Xbox Specific Support 0 2005-07-24 18:59
New controllist functionality in cvs Asteron Plugin/Script (Python) Development 5 2005-04-05 02:14


All times are GMT +2. The time now is 20:45.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project