Ejemplo n.º 1
0
#class TestClass(HasTraits):
#    b1 = Bool
#    b2 = Bool
#    b3 = Bool
#    _updated = Bool(False)

#
#for e in dir(view1):
#    print e

#for attr in ['b1', "title", "handler", "buttons"]:
#    print attr, getattr(view1, attr, None)

#tc = TestClass()
#tc.add_trait( 'b4',Bool)

t = HasTraits()
nameL = []
for i in range(4):
    name = 'r%d' % i
    t.add_trait(name, Range(1, 10, i))
    nameL.append(name)

view1 = View(nameL,
             title="Alter Title",
             handler=TC_Handler(),
             buttons=['OK', 'Cancel'])

t.configure_traits(view=view1)
Ejemplo n.º 2
0
#class TestClass(HasTraits):
#    b1 = Bool
#    b2 = Bool
#    b3 = Bool
#    _updated = Bool(False)


#
#for e in dir(view1):
#    print e

#for attr in ['b1', "title", "handler", "buttons"]:
#    print attr, getattr(view1, attr, None)

#tc = TestClass()
#tc.add_trait( 'b4',Bool)

t = HasTraits()
nameL = []
for i in range(4):
    name = 'r%d'%i
    t.add_trait(name, Range(1,10,i) )
    nameL.append(name)

view1 = View(nameL,
             title="Alter Title",
             handler=TC_Handler(),
             buttons = ['OK', 'Cancel'])

t.configure_traits(view=view1)