Example #1
0
from pyface.base_toolkit import Toolkit

toolkit_object = Toolkit('tvtk', 'wx', 'tvtk.pyface.ui.wx')
Example #2
0
# Author: Riverbank Computing Limited and Enthought developers
#------------------------------------------------------------------------------


import sys

from pyface.qt import QtCore, QtGui, qt_api
from pyface.base_toolkit import Toolkit

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
        )

    if QtCore.PYQT_VERSION < 0x040100:
        raise RuntimeError(
            "Need PyQt v4.1 or higher, but got v%s" % QtCore.PYQT_VERSION_STR
        )

# It's possible that it has already been initialised.
_app = QtGui.QApplication.instance()

if _app is None:
    _app = QtGui.QApplication(sys.argv)


# create the toolkit object
toolkit_object = Toolkit('qt4', 'pyface.ui.qt4')
Example #3
0
# (C) Copyright 2005-2022 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
""" Initialize this backend.
"""
from pyface.base_toolkit import Toolkit
from traits.etsconfig.api import ETSConfig


def _wrapper(func):
    def wrapped(name):
        # Prefix object lookups with the name of the configured kiva backend.
        return func(f'{ETSConfig.kiva_backend}:{name}')

    return wrapped


toolkit = _wrapper(Toolkit("enable", "wx", "enable.wx"))
Example #4
0
#------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#------------------------------------------------------------------------------
""" Initialize this backend.
"""

# There is nothing for us to initialize, but the toolkit switching code depends
# on the existence of this module.
from pyface.base_toolkit import Toolkit

toolkit_object = Toolkit('tvtk', 'null', 'tvtk.pyface.ui.null')

#### EOF ######################################################################
Example #5
0
import wx

from traits.trait_notifiers import set_ui_handler, ui_handler

from pyface.base_toolkit import Toolkit
from .gui import GUI

# Check the version number is late enough.
if wx.VERSION < (2, 8):
    raise RuntimeError("Need wx version 2.8 or higher, but got %s" %
                       str(wx.VERSION))

# It's possible that it has already been initialised.
_app = wx.GetApp()
if _app is None:
    _app = wx.App()

# stop logging to a modal window by default
# (apps can override by setting a different active target)
_log = wx.LogStderr()
wx.Log.SetActiveTarget(_log)

# create the toolkit object
toolkit_object = Toolkit('pyface', 'wx', 'pyface.ui.wx')

# ensure that Traits has a UI handler appropriate for the toolkit.
if ui_handler is None:
    # Tell the traits notification handlers to use this UI handler
    set_ui_handler(GUI.invoke_later)
Example #6
0
 class MonkeyPatchPyface(object):
     toolkit_object = Toolkit('wx', 'pyface.ui.wx')
Example #7
0
# (C) Copyright 2005-2022 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
# (C) Copyright 2007 Riverbank Computing Limited
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
""" Initialize this backend.
"""

from pyface.base_toolkit import Toolkit

toolkit_object = Toolkit("pyface", "null", "pyface.ui.null")
Example #8
0
# (C) Copyright 2005-2022 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
""" Initialize this backend.
"""
from pyface.base_toolkit import Toolkit
from traits.etsconfig.api import ETSConfig


def _wrapper(func):
    def wrapped(name):
        # Prefix object lookups with the name of the configured kiva backend.
        return func(f'{ETSConfig.kiva_backend}:{name}')

    return wrapped


toolkit = _wrapper(Toolkit("enable", "null", "enable.null"))
Example #9
0
import wx

from traits.trait_notifiers import set_ui_handler, ui_handler

from pyface.base_toolkit import Toolkit
from .gui import GUI

# Check the version number is late enough.
if wx.VERSION < (2, 8):
    raise RuntimeError("Need wx version 2.8 or higher, but got %s" %
                       str(wx.VERSION))

# It's possible that it has already been initialised.
_app = wx.GetApp()
if _app is None:
    _app = wx.App()

# stop logging to a modal window by default
# (apps can override by setting a different active target)
_log = wx.LogStderr()
wx.Log.SetActiveTarget(_log)

# create the toolkit object
toolkit_object = Toolkit("pyface", "wx", "pyface.ui.wx")

# ensure that Traits has a UI handler appropriate for the toolkit.
if ui_handler is None:
    # Tell the traits notification handlers to use this UI handler
    set_ui_handler(GUI.invoke_later)
Example #10
0
#------------------------------------------------------------------------------
# Copyright (c) 2007, Riverbank Computing Limited
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions described in the aforementioned license.  The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#------------------------------------------------------------------------------
""" Initialize this backend.
"""

from pyface.base_toolkit import Toolkit

toolkit_object = Toolkit('null', 'pyface.ui.null')
Example #11
0
File: init.py Project: pbrod/pyface
from pyface.base_toolkit import Toolkit
from .gui import GUI

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
        )

    if QtCore.PYQT_VERSION < 0x040100:
        raise RuntimeError(
            "Need PyQt v4.1 or higher, but got v%s" % QtCore.PYQT_VERSION_STR
        )

# It's possible that it has already been initialised.
_app = QtGui.QApplication.instance()

if _app is None:
    _app = QtGui.QApplication(sys.argv)


# create the toolkit object
toolkit_object = Toolkit("pyface", "qt4", "pyface.ui.qt4")


# ensure that Traits has a UI handler appropriate for the toolkit.
if ui_handler is None:
    # Tell the traits notification handlers to use this UI handler
    set_ui_handler(GUI.invoke_later)
Example #12
0
# (C) Copyright 2005-2022 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
# Dummy toolkit for testing entrypoints

from pyface.base_toolkit import Toolkit

toolkit_object = Toolkit("pyface", "test", "pyface.tests.test_new_toolkit")
Example #13
0
# Dummy toolkit for testing entrypoints

from pyface.base_toolkit import Toolkit

toolkit_object = Toolkit('test', 'pyface.tests.test_new_toolkit')
Example #14
0
from pyface.base_toolkit import Toolkit

toolkit_object = Toolkit('tvtk', 'qt4', 'tvtk.pyface.ui.qt4')
Example #15
0
# (C) Copyright 2005-2022 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!
""" Initialize this backend.
"""
from pyface.base_toolkit import Toolkit
from traits.etsconfig.api import ETSConfig


def _wrapper(func):
    def wrapped(name):
        # Prefix object lookups with the name of the configured kiva backend.
        return func(f'{ETSConfig.kiva_backend}:{name}')

    return wrapped


toolkit = _wrapper(Toolkit("enable", "qt4", "enable.qt4"))