AccordionView, storing groups in separate modules

RoboFont Forums Help / General AccordionView, storing groups in separate modules

Tagged: 

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5450

    joanca
    Participant

    Next with AV, I’m trying to store separately the several groups to avoid a long long script and make easier maintaining. Is this possible? If yes, I’m doing something wrong. I attach both the launcher script and a module with a group.
    Dank u

    Attachments:
    You must be logged in to view attached files.
    #5452

    frederik
    Keymaster

    you can only add vanilla like objects in an AccordionView, in your example the class aGroup is not a vanilla like object

    use:

    from vanilla import *
    
    class aGroup(Group):
    
        def __init__(self):
    
            super(aGroup, self).__init__((0, 0, -0, -0))
            self.PopUpButton = PopUpButton((10, 10, -10, -10),
                                                    ['PopUpButton'],
                                                    sizeStyle='small')
    

    good luck!

    #5453

    joanca
    Participant

    Still not working with the launcher code :(
    Sorry for worst formatting ever.

    from mojo.UI import AccordionView
    from vanilla import *
    from storegroup import aGroup
    
    class launcher:
    
        def __init__(self):
    
            self.w = FloatingWindow((200, 600), title='accordionView')
    
            self.agroup = aGroup()
    
            descriptions = [
                dict(label="aGroup", view=self.agroup, size=117, collapsed=False, canResize=False)
            ]
    
            self.w.accordionView = AccordionView((0, 0, -0, -0), descriptions)
    
            self.w.open()
    
    
    launcher()
    

    BTW, is there a guide somewhere to correctly format in posts?

    #5454

    frederik
    Keymaster

    euh?

    an AccordionView only takes a vanilla like object, best is to subclass a vanilla.Group and add UI elements in there.

    good luck

    (a working version attached)

    Attachments:
    You must be logged in to view attached files.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.