Splitter sets fixed height

16 views
Skip to first unread message

cryzed

unread,
Oct 24, 2018, 7:18:13 PM10/24/18
to Enaml
Hello, I have the following Enaml code:

from enaml.widgets.api import MainWindow, MenuBar, Menu, Action, Container, Splitter, SplitItem, FlowArea, FlowItem, Label, Field

enamldef MainWindow(MainWindow):
    title = 'Serpens'
    MenuBar:
        Menu:
            title = '&File'
            Action:
                text = 'Import...'
            Action:
                separator = True
            Action:
                text = 'Exit\tCtrl+X'
                triggered :: exit()
    Container:
        background = 'green'
        Splitter:
            background = 'red'
            SplitItem:
                Container:
                    Label:
                        text = 'test'
            SplitItem:
                Container:
                    Label:
                        text = 'test'

which results in this: https://i.imgur.com/zEGZT4K.png. Can I get a tip/explanation why apparently the containers in the SplitItem suddenly start setting a fixed height? I expected the Container to take all available space, the Splitter as well and the SplitItems and their containers as well. Somehow it seems like the height is fixed to the smallest contained element now. Do I need to write custom constraints for this?

cryzed

unread,
Oct 24, 2018, 7:39:38 PM10/24/18
to Enaml
I figured it out, it was the Field. When I set the constraints with `vbox(field, spacer)` in the parent container it works as expected.
Reply all
Reply to author
Forward
0 new messages