Generate interface elements through iteration



  • Hello RoboUsers!

    This question is a bit off topic because it concerns vanilla, but I think someone could help me anyway here.

    I am trying to generate some elements in an interface through an iteration over a dictionary.

    Starting from a list of colors stored into a csv file, I need to generate some controls in order to modify the colors.

    The first file attached is a sketch of what I want to achieve.

    The number of rows has to set automatically according to the number of the dictionary pairs.

    Here you can see a draft of my code:
    https://gist.github.com/roberto-arista/6b0dc3a7b46a874d56dd

    In the second attached file (screenshot) you can see what appears, only the first element of the dictionary is displayed.

    Does anyone has advices? Case studies to look at?
    Thanks!


  • admin

    inside a vanilla.Group everything the position relative to the parent vanilla.Group. You are using the colors_y value to set the TextBox and ColorWell inside a group that you add to a window.

    posted a fix here http://gist.github.com/roberto-arista/6b0dc3a7b46a874d56dd

    good luck



  • Oh! This is quite embarrassing.
    Thanks!