Debian Codegraph @

integrationtests/ui/shell_editor_test.py

raw
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 Dict, Float, HasPrivateTraits, Int, Str
12 from traitsui.api import Item, ShellEditor, View
13
14 # -------------------------------------------------------------------------
15 # 'ShellTest' class:
16 # -------------------------------------------------------------------------
17
18
19 class ShellTest(HasPrivateTraits):
20
21 # -------------------------------------------------------------------------
22 # Trait definitions:
23 # -------------------------------------------------------------------------
24
25 name = Str()
26 age = Int()
27 weight = Float()
28 shell_1 = Str()
29 shell_2 = Dict()
30
31 # -------------------------------------------------------------------------
32 # Traits view definitions:
33 # -------------------------------------------------------------------------
34
35 view = View(
36 'name',
37 'age',
38 'weight',
39 '_',
40 Item('shell_1', editor=ShellEditor()),
41 Item('shell_2', editor=ShellEditor()),
42 id='traitsui.tests.shell_editor_test',
43 resizable=True,
44 width=0.3,
45 height=0.3,
46 )
47
48
49 # -------------------------------------------------------------------------
50 # Run the test:
51 # -------------------------------------------------------------------------
52
53 if __name__ == '__main__':
54 ShellTest().configure_traits()