Exemplo n.º 1
0
 def test_auto_window(self):
     model = AllTypes()
     window = auto_window(model=model)
     with self.event_loop():
         window.show()
     self.check_component_counts(window)
     self.check_label_text(window)
Exemplo n.º 2
0
 def test_auto_window(self):
     model = AllTypes()
     window = auto_window(model=model)
     with self.event_loop():
         window.show()
     self.check_component_counts(window)
     self.check_label_text(window)
Exemplo n.º 3
0
    int_value = Int(42, tooltip="You can add a tooltip as well.")
    float_value = Float(3.141592)
    enum_value = Enum("foo", "bar", "baz", "qux")
    int_range_value = Range(low=0, high=10)
    float_range_value = Range(low=0.0, high=1.0)
    list_value = List([0, 1, 2])
    str_value = Str("Word")
    date_value = Date(datetime.date.today())
    time_value = Time(datetime.time())
    range_value = Range(low=0,
                        high=100,
                        label="Traits Range Editor:",
                        enaml_editor=DefaultEditor)

    _my_float = Float

    def _button_value_fired(self):
        print "Button was pressed"

    def _anytrait_changed(self, name, old, new):
        print name, "changed from", old, "to", new


if __name__ == '__main__':
    all = AllTypes()
    app = QtApplication()
    view = auto_window(all)
    view.show()

    app.start()
Exemplo n.º 4
0
    boolean_value = Bool(True, label="Custom Bool Label:")
    button_value = Button("I'm a button!")
    int_value = Int(42, tooltip="You can add a tooltip as well.")
    float_value = Float(3.141592)
    enum_value = Enum("foo", "bar", "baz", "qux")
    int_range_value = Range(low=0, high=10)
    float_range_value = Range(low=0.0, high=1.0)
    list_value = List([0, 1, 2])
    str_value = Str("Word")
    date_value = Date(datetime.date.today())
    time_value = Time(datetime.time())
    range_value = Range(low=0, high=100,
                        label="Traits Range Editor:",
                        enaml_editor=DefaultEditor)

    _my_float = Float

    def _button_value_fired(self):
        print "Button was pressed"

    def _anytrait_changed(self, name, old, new):
        print name, "changed from", old, "to", new

if __name__ == '__main__':
    all = AllTypes()
    app = QtApplication()
    view = auto_window(all)
    view.show()

    app.start()