Adding more than one item to a AccordionView description

RoboFont Forums Help / General Adding more than one item to a AccordionView description

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  frederik 7 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5446

    joanca
    Participant

    Following the example in: http://doc.robofont.com/api/mojo/mojo-ui/

    How can I add more than one item to a view (or description)?
    I’ve tried with vanilla.group, making a list… didn’t find out.

    Thanks!

    #5449

    frederik
    Keymaster

    he

    I’ve updated the example: http://doc.robofont.com/api/mojo/mojo-ui/

    from mojo.UI import AccordionView
    from vanilla import *
    
    class MyInspector:
    
        def __init__(self):
    
            self.w = FloatingWindow((200, 600))
    
            self.firstItem = TextEditor((10, 10, -10, -10))
    
            self.secondItem = List((0, 0, -0, -0), ["a", "b", "c"])
    
            self.thirdItem = Tabs((10, 10, -10, -10), ["1", "2", "3"])
            
            self.fourthItem = Group((0, 0, -0, -0))
            
            self.fourthItem.checkBox = CheckBox((10, 10, 100, 22), "CheckBox")
            self.fourthItem.editText = EditText((10, 40, -10, 22))
            
    
            descriptions = [
                           dict(label="first item", view=self.firstItem, size=200, collapsed=False, canResize=False),
                           dict(label="second item", view=self.secondItem, minSize=100, size=140, collapsed=True, canResize=True),
                           dict(label="third item", view=self.thirdItem, minSize=100, size=140, collapsed=True, canResize=False),
                           dict(label="fourth item", view=self.fourthItem, size=140, collapsed=False, canResize=False)
                           ]
    
            self.w.accordionView = AccordionView((0, 0, -0, -0), descriptions)
    
            self.w.open()
    
    MyInspector()
    

    good luck

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.