Closed tuomas2 closed 10 years ago
Thanks @tuomas2, do you have any small example that demonstrates the problem?
Here you are:
traits_view.enaml
enamldef Obj(TraitsView):
attr person
model := person
enamldef PersonView(Window):
attr person
Container:
ScrollArea:
Container:
Include:
objects = [Obj(person=person) for i in range(100)]
and person.py:
from traits.api import HasTraits, Str, Range
import enaml
from enaml.qt.qt_application import QtApplication
class Person(HasTraits):
""" A simple class representing a person object.
"""
last_name = Str()
first_name = Str()
age = Range(low=0)
if __name__ == '__main__':
with enaml.imports():
from traits_view import PersonView
john = Person(first_name='John', last_name='Doe', age=42)
app = QtApplication()
view = PersonView(person=john)
view.show()
app.start()
Thanks, @tuomas2.
I can verify the issue.
When creating many TraitsView objects with Include, window flickers and looks like it is creating (and closing) a new window at the creation of each TraitsView object.