AccordionView, storing groups in separate modules
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.
you can only add vanilla like objects in an
AccordionView, in your example the class
aGroupis not a vanilla like object
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')
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?
AccordionViewonly takes a vanilla like object, best is to subclass a
vanilla.Groupand add UI elements in there.
(a working version attached)