Example #1
0
#
# 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:
# -------------------------------------------------------------------------

_QT_TRAITS_EVENT = QtCore.QEvent.Type(QtCore.QEvent.registerEventType())

Example #2
0
"""

#-------------------------------------------------------------------------
#  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
from traitsui.dock_window_theme import DockWindowTheme
from traitsui.toolkit import Toolkit

from .constants import WindowColor, screen_dx, screen_dy
from .helper import position_window
Example #3
0
#-------------------------------------------------------------------------
#  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
from traitsui.dock_window_theme import DockWindowTheme
from traitsui.toolkit import Toolkit

from .constants import WindowColor, screen_dx, screen_dy
from .helper import position_window

#-------------------------------------------------------------------------