| 1 |
# (C) Copyright 2004-2023 Enthought, Inc., Austin, TX |
| 2 |
# All rights reserved. |
| 3 |
# |
| 4 |
# This software is provided without warranty under the terms of the BSD |
| 5 |
# license included in LICENSE.txt and may be redistributed only under |
| 6 |
# the conditions described in the aforementioned license. The license |
| 7 |
# is also available online at http://www.enthought.com/licenses/BSD.txt |
| 8 |
# |
| 9 |
# Thanks for using Enthought open source! |
| 10 |
|
| 11 |
from traits.api import HasTraits, List, Str |
| 12 |
from traitsui.api import Item, SetEditor, View |
| 13 |
|
| 14 |
|
| 15 |
class Team(HasTraits): |
| 16 |
|
| 17 |
batting_order = List(Str) |
| 18 |
roster = List(['Tom', 'Dick', 'Harry', 'Sally'], Str) |
| 19 |
|
| 20 |
view = View( |
| 21 |
Item('batting_order', editor=SetEditor(name='roster', ordered=True)), |
| 22 |
'_', |
| 23 |
'roster@', |
| 24 |
height=500, |
| 25 |
resizable=True, |
| 26 |
) |
| 27 |
|
| 28 |
|
| 29 |
if __name__ == '__main__': |
| 30 |
Team().configure_traits() |