enthought / traitsui

TraitsUI: Traits-capable windowing framework
http://docs.enthought.com/traitsui
Other
297 stars 95 forks source link

"springy" attribute not honored #169

Open rwb27 opened 10 years ago

rwb27 commented 10 years ago

Hello, I'm trying to lay out a traits view nicely, with a graph on one side and some controls on the other side. I'd like the controls to take up a fixed width and the graph to expand when the view is resized. However, depending (somehow, haven't figured out how) on the items in the group, both columns resize at the same time, despite one being springy and the other not. I'm using traitsui 4.4.0 I can reproduce the issue fairly easily here:

from traits.api import HasTraits, Float, Range, Button
from traitsui.api import View, HGroup, VGroup, Item, Spring

class foo(HasTraits):
    size = Range(2.,20.,5.)
    test = Button()
    expunge= Button()
    duration = Float(10)

    traits_view = View(
        HGroup(
            VGroup(
                Item(name="size",resizable=False),
                Item(name="test",width=100,springy=False),
                Item(name="duration"),
            springy=False,
            ),
            Item(name="expunge",springy=True),
        ),
        resizable=True,
    )
    pass

f = foo()
f.configure_traits()
'''

Perhaps I'm being silly, but it looks to me like the "springy" attribute is not being honoured...

thanks,

Richard
corranwebster commented 9 years ago

Is this under Wx or Qt? I think there is a long-known issue with springy on Wx, but it should work when using Qt.

rwb27 commented 9 years ago

Under Qt I'm afraid...