How to use the enaml.widgets.api.Window function in enaml

To help you get started, we’ve selected a few enaml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MatthieuDartiailh / HQCMeas / tests / tasks / logic_tasks / test_loop_task.py View on Github external
def test_view2(self):
        # Intantiate a view with a selected interface.
        interface = LinspaceLoopInterface()
        self.task.interface = interface

        window = enaml.widgets.api.Window()
        core = self.workbench.get_plugin('enaml.workbench.core')
        LoopView(window, task=self.task, core=core)
        window.show()

        process_app_events()

        assert_is(self.task.interface, interface)
github MatthieuDartiailh / HQCMeas / tests / util.py View on Github external
def close_all_windows():
    qapp = QtApplication.instance()._qapp
    qapp.flush()
    qapp.processEvents()
    sleep(0.1)
    for window in Window.windows:
        window.close()
    qapp.flush()
    qapp.processEvents()
github nucleic / enaml / tests / utils.py View on Github external
def get_window(qtbot, cls=Window, timeout=1000):
    """Convenience function running the event loop and returning the first
    window found in the set of active windows.

    Parameters
    ----------
    cls : type, optional
        Type of the window which should be returned.

    timeout : int, optional
        Timeout after which the operation should fail in ms

    Returns
    -------
    window : Window or None
        Return the first window found matching the specified class
github MatthieuDartiailh / HQCMeas / tests / tasks / instr_tasks / test_pna_tasks.py View on Github external
def test_view1(self):
        # Intantiate a view with no selected interface and select one after
        window = enaml.widgets.api.Window()
        core = self.workbench.get_plugin('enaml.workbench.core')
        view = RFFrequencyView(window, task=self.task, core=core)
        window.show()

        process_app_events()

        assert_in('AgilentPNA', view.drivers)
        self.task.selected_driver = 'AgilentPNA'
        process_app_events()
        assert_is_instance(self.task.interface, PNASetRFFrequencyInterface)
github MatthieuDartiailh / HQCMeas / tests / tasks / logic_tasks / test_loop_task.py View on Github external
def test_view1(self):
        # Intantiate a view with no selected interface and select one after
        window = enaml.widgets.api.Window()
        core = self.workbench.get_plugin('enaml.workbench.core')
        view = LoopView(window, task=self.task, core=core)
        window.show()

        process_app_events()

        view.widgets()[1].selected = LinspaceLoopInterface
        process_app_events()
        assert_is_instance(self.task.interface, LinspaceLoopInterface)

        view.widgets()[1].selected = IterableLoopInterface
        process_app_events()
        assert_is_instance(self.task.interface, IterableLoopInterface)
github MatthieuDartiailh / HQCMeas / tests / tasks / util_tasks / test_array_tasks.py View on Github external
def test_view(self):
        # Intantiate a view with no selected interface and select one after
        window = enaml.widgets.api.Window()
        view = ArrayExtremaView(window, task=self.task)
        window.show()

        process_app_events()
github MatthieuDartiailh / HQCMeas / tests / tasks / instr_tasks / test_stepper_task.py View on Github external
def test_view1(self):
        # Intantiate a view with no selected interface and select one after
        window = enaml.widgets.api.Window()
        core = self.workbench.get_plugin('enaml.workbench.core')
        view = SteppingView(window, task=self.task, core=core)
        window.show()

        process_app_events()
github MatthieuDartiailh / HQCMeas / tests / tasks / instr_tasks / test_set_dc_voltage.py View on Github external
def test_view1(self):
        # Intantiate a view with no selected interface and select one after
        window = enaml.widgets.api.Window()
        core = self.workbench.get_plugin('enaml.workbench.core')
        view = SetDcVoltageView(window, task=self.task, core=core)
        window.show()

        process_app_events()

        assert_in('YokogawaGS200', view.drivers)
        self.task.selected_driver = 'YokogawaGS200'
        process_app_events()
        assert_is(self.task.interface, None)

        assert_in('TinyBilt', view.drivers)
        self.task.selected_driver = 'TinyBilt'
        process_app_events()
        assert_is_instance(self.task.interface,
                           MultiChannelVoltageSourceInterface)
github MatthieuDartiailh / HQCMeas / tests / tasks / instr_tasks / test_rf_tasks.py View on Github external
def test_view1(self):
        # Intantiate a view with no selected interface and select one after
        window = enaml.widgets.api.Window()
        core = self.workbench.get_plugin('enaml.workbench.core')
        view = RFPowerView(window, task=self.task, core=core)
        window.show()

        process_app_events()

        assert_in('AgilentE8257D', view.drivers)
        self.task.selected_driver = 'AgilentE8257D'
        process_app_events()
        assert_is(self.task.interface, None)
github MatthieuDartiailh / HQCMeas / tests / tasks / instr_tasks / test_pna_tasks.py View on Github external
def test_view2(self):
        # Intantiate a view with a selected interface.
        self.task.interface = PNASetRFFrequencyInterface(task=self.task)
        self.task.frequency = '1.0'
        self.task.selected_driver = 'AgilentPNA'

        interface = self.task.interface

        window = enaml.widgets.api.Window()
        core = self.workbench.get_plugin('enaml.workbench.core')
        RFFrequencyView(window, task=self.task, core=core)
        window.show()

        process_app_events()

        assert_is(self.task.interface, interface)