# # Author: David C. Morrill # Date: 10/13/2004 # #------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the wxPython user interface toolkit. """ #------------------------------------------------------------------------------- # Imports: #------------------------------------------------------------------------------- # Make sure that importimg from this backend is OK: from traitsui.toolkit import assert_toolkit_import assert_toolkit_import('wx') import wx # Make sure a wx.App object is created early: _app = wx.GetApp() if _app is None: _app = wx.App(redirect=False) from traits.api \ import HasPrivateTraits, Instance, Property, Category, cached_property from traits.trait_notifiers \ import set_ui_handler from traitsui.ui \
# in the PyQt GPL exception also apply. # # Author: Riverbank Computing Limited #------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the PyQt user interface toolkit. """ #------------------------------------------------------------------------- # Imports: #------------------------------------------------------------------------- # Make sure that importing from this backend is OK: from traitsui.toolkit import assert_toolkit_import assert_toolkit_import('qt4') from pyface.qt import QtCore, QtGui, qt_api if qt_api == 'pyqt': # Check the version numbers are late enough: if QtCore.QT_VERSION < 0x040200: raise RuntimeError("Need Qt v4.2 or higher, but got v%s" % QtCore.QT_VERSION_STR) # Make sure a QApplication object is created early: import sys if QtGui.QApplication.startingUp(): _app = QtGui.QApplication(sys.argv) from traits.trait_notifiers import set_ui_handler
# All rights reserved. # # This software is provided without warranty under the terms of the BSD license. # However, when used with the GPL version of PyQt the additional terms described # in the PyQt GPL exception also apply. # # Author: Riverbank Computing Limited # ------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the PyQt user interface toolkit. """ # Make sure that importing from this backend is OK: from traitsui.toolkit import assert_toolkit_import assert_toolkit_import(["qt4", "qt"]) # Ensure that we can import Pyface backend. This starts App as a side-effect. from pyface.toolkit import toolkit_object as pyface_toolkit _app = pyface_toolkit("init:_app") from traits.trait_notifiers import set_ui_handler from pyface.qt import QtCore, QtGui, qt_api from traitsui.toolkit import Toolkit from .constants import screen_dx, screen_dy # ------------------------------------------------------------------------- # Handles UI notification handler requests that occur on a thread other than # the UI thread:
# Date: 10/13/2004 # #------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the wxPython user interface toolkit. """ #------------------------------------------------------------------------- # Imports: #------------------------------------------------------------------------- # Make sure that importimg from this backend is OK: from __future__ import absolute_import from traitsui.toolkit import assert_toolkit_import assert_toolkit_import(['wx']) import wx # Ensure that we can import Pyface backend. This starts App as a side-effect. from pyface.toolkit import toolkit_object as pyface_toolkit _app = pyface_toolkit('init:_app') from traits.api import ( HasPrivateTraits, Instance, Property, Category, cached_property ) from traits.trait_notifiers import set_ui_handler from pyface.wx.drag_and_drop import PythonDropTarget from traitsui.theme import Theme from traitsui.ui import UI
# Thanks for using Enthought open source! # # Author: David C. Morrill # Date: 10/13/2004 # # ------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the wxPython user interface toolkit. """ # Make sure that importimg from this backend is OK: import logging from traitsui.toolkit import assert_toolkit_import assert_toolkit_import(["wx"]) import wx # Ensure that we can import Pyface backend. This starts App as a side-effect. from pyface.toolkit import toolkit_object as pyface_toolkit _app = pyface_toolkit("init:_app") from traits.api import HasPrivateTraits, Instance from traits.trait_notifiers import set_ui_handler from pyface.wx.drag_and_drop import PythonDropTarget from traitsui.theme import Theme from traitsui.ui import UI from traitsui.toolkit import Toolkit
# Date: 10/13/2004 # #------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the wxPython user interface toolkit. """ #------------------------------------------------------------------------- # Imports: #------------------------------------------------------------------------- # Make sure that importimg from this backend is OK: from __future__ import absolute_import from traitsui.toolkit import assert_toolkit_import assert_toolkit_import(['wx']) import wx # Ensure that we can import Pyface backend. This starts App as a side-effect. from pyface.toolkit import toolkit_object as pyface_toolkit _app = pyface_toolkit('init:_app') from traits.api import (HasPrivateTraits, Instance, Property, Category, cached_property) from traits.trait_notifiers import set_ui_handler from pyface.wx.drag_and_drop import PythonDropTarget from traitsui.theme import Theme from traitsui.ui import UI
# # Author: Riverbank Computing Limited #------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the PyQt user interface toolkit. """ #------------------------------------------------------------------------- # Imports: #------------------------------------------------------------------------- # Make sure that importing from this backend is OK: from __future__ import absolute_import from traitsui.toolkit import assert_toolkit_import assert_toolkit_import(['qt4', 'qt']) # Ensure that we can import Pyface backend. This starts App as a side-effect. from pyface.toolkit import toolkit_object as pyface_toolkit _app = pyface_toolkit('init:_app') from traits.trait_notifiers import set_ui_handler from pyface.qt import QtCore, QtGui, qt_api from traitsui.toolkit import Toolkit from .constants import screen_dx, screen_dy #------------------------------------------------------------------------- # Handles UI notification handler requests that occur on a thread other than # the UI thread: #-------------------------------------------------------------------------
# Author: David C. Morrill # Date: 10/13/2004 # #------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the wxPython user interface toolkit. """ #------------------------------------------------------------------------------- # Imports: #------------------------------------------------------------------------------- # Make sure that importimg from this backend is OK: from traitsui.toolkit import assert_toolkit_import assert_toolkit_import('wx') import wx # Make sure a wx.App object is created early: _app = wx.GetApp() if _app is None: _app = wx.PySimpleApp() from traits.api \ import HasPrivateTraits, Instance, Property, Category, cached_property from traits.trait_notifiers \ import set_ui_handler from traitsui.ui \
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS # IN THE SOFTWARE. #------------------------------------------------------------------------------ """ Defines the concrete implementations of the traits Toolkit interface for the Muntjac user interface toolkit. """ #------------------------------------------------------------------------------ # Imports: #------------------------------------------------------------------------------ # Make sure that importing from this backend is OK: from traitsui.toolkit import assert_toolkit_import assert_toolkit_import('muntjac') from muntjac.api import Application # Make sure the Application object is created early: _app = Application() from traits.trait_notifiers import set_ui_handler from traitsui.toolkit import Toolkit from constants import screen_dx, screen_dy #------------------------------------------------------------------------------ # Handles UI notification handler requests: #------------------------------------------------------------------------------