by jboissinot » Mon Feb 08, 2021 9:50 pm
Hi,
I was actually planning to ask about this, so I'm glad that it has been discussed already, and thanks for sharing a solution on how we could it.
I did some testing on my own to explore this but I noticed something wrong. In fact, let's say that I create 3 contexts, A, B, and C, in a context.
If I print the index of all contexts, I do get 0 for A, 1 for B, and 2 for C. However, if I rename A with D, then I'm getting index 1 for C while it should still be 2. Looks like it might return the creation index and not the display index. Maybe that's normal and expected actually, I just thought that find_item_index() would return the actual position of an item in a context.
Can you clarify this to make sure that what I assume makes sense or if it's a bug with the API?
Thanks,
Jeremy