I've managed to boil down the problem to the simplest possible code:
from atom.api import Atom, Typed
from enaml.core.api import Declarative, d_
from enaml.widgets.api import MainWindow
class Bar(Atom):
pass
class Foo(Declarative):
x = d_(Typed(Bar))
enamldef Main(MainWindow):
Foo:
initialized ::
self.x = Bar()
x ::
# This never gets triggered!
print('First foo changed')
Foo:
initialized ::
self.x
self.x = Bar()
x ::
# This gets triggered!
print('Second foo changed')
The key difference between appears to be that the first generates only one event (create) whereas the second generates a create followed by an update event. I'd like the :: operator to respond to both create and update notifications. Is there any simple approach to solving this problem?