enthought/enaml — Issue #18: Listeners affecting widget initialization
Author: corranwebster
Created: 2011-11-09 11:51:06+00:00
State: open

The following enaml code does not work as expected:

defn MainWindow:
Window:
Label:
text << 'CheckBox is %s' % cb.checked
CheckBox -> cb:
text = 'Should be checked'
checked = True

When the widget comes up, the check box is not checked. If you remove the label it works as expected, and the following code also works as expected:

defn MainWindow:
Window:
CheckBox -> cb:
text = 'Should be checked'
checked = True
Label:
text << 'CheckBox is %s' % cb.checked```

Clearly there is something messed up here to do with order of initialization and binding.