I tested below code. but how can I get the index of selected control
in Sizer?
def GetItemIndex(self, item):
sItem = self.Autosizer.GetItem(item)<-------- this will bring
the controls in Autosizer
assert sItem is not None, "Item not found in the sizer."
allItems = self.Children<----------- this will bring the
controls in TestPanel
idx = 0
for i in allItems:
print "items : %s"%i.this
print "selected : %s"%sItem.this
if i.this == sItem.this:<-------------- when debugging
time, the code skips here.
break
idx += 1
return idx
sItem = self.Autosizer.GetItem(item)
assert sItem is not None, "Item not found in the sizer."
allItems = self.Autosizer.GetChildren()
idx = 0
for i in allItems:
if i.this == sItem.this:
break
idx += 1
return idx