![]() |
|
How to : Synchronise 2 lists - Printable Version +- XBMC Community Forum (http://forum.xbmc.org) +-- Forum: Development (/forumdisplay.php?fid=32) +--- Forum: Python Add-on Development (/forumdisplay.php?fid=26) +--- Thread: How to : Synchronise 2 lists (/showthread.php?tid=17911) |
- solexalex - 2006-02-04 17:32 hi everybody ! maybe i'm not the first to find this trick, it is not the question, but i found a way to synchronise 2 lists... (or more) you 'browse' items of one of the list, and the other one move in the same time. that way, item number x of the 1st list is always in front of item number x of 2nd list !! this can be very helpfull for drawing arrays on xbmc screen... it is very simple to do, anyway, mismatch can happen when using pad triggers to move fast inside the list... have a look in it and just tell me. this example shows in a 1st list the sum of 2 numbers and in a second list the result for each sum... here is a link : http://xbmc-scripts.gx-mod.com/documents/codes/synchro_lists.py and here is the code (not sure it will look correctly indented here) : Quote:#this simple script example will show you how to - Asteron - 2006-02-04 20:17 ohh i get it so this is like a poor man's table control with each list as a column.... pretty clever.. actually this doesnt look like it would take into account scrolling. i know that when using scroll events the selection in a list stays near the center but when using move events the selection is near the edge. page up/down doesnt move the selection (just the scroll amount). i don't know how selectitem works though (it was added after the table i implemented for the stock script). but i don't think it could replicate that behavior? it seems like you would need a way to get/set scroll amount to do this... am i missing something maybe? - diagdave@msn.com - 2006-02-05 02:19 so it just selects the same list item number as the one selected each time u press a key? - solexalex - 2006-02-05 17:16 hi ! i'm not sure to understand what asteron says (sorry...) but diagdave is right : Quote:it just selects the same list item number as the one selected each time u press a keyexactly. anyway,maybe it is not a real trick for advanced xbmc python scripters, but it can be very useful |