Last active
August 29, 2015 14:12
-
-
Save chozabu/57c1a5ee96f2ea08b692 to your computer and use it in GitHub Desktop.
testing zorder in kivy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.uix.widget import Widget | |
from random import randint | |
def getzs(tw): | |
zs = [] | |
for i in tw.children: | |
zs.append(i.zindy) | |
return zs | |
order = [1,0,9,3,7,5,4,6,8,2] | |
a=Widget() | |
for i in range(10): | |
neww = Widget() | |
neww.zindy = order[i] | |
a.add_widget(neww, index=neww.zindy) | |
#print item.inserted and children.after.insertion | |
print neww.zindy, getzs(a) | |
''' | |
final order: | |
[0, 1, 2, 9, 3, 4, 7, 6, 5, 8] | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment