enable.abstract_window module

class enable.abstract_window.AbstractWindow(**traits)[source]

Bases: traits.has_traits.HasTraits

MAX_DAMAGED_REGIONS = 100
cleanup()[source]

Clean up after ourselves.

component_bounds_updated(event)[source]

Dynamic trait listener that handles our component changing its size.

get_pointer_position()[source]

Returns the current pointer position in local window coordinates.

Returns

(x, y) – The x,y position of the mouse

Return type

tuple

invalidate_draw(damaged_regions=None, self_relative=False)[source]
redraw()[source]

Requests that the window be redrawn.

screen_to_window(x, y)[source]

Returns local window coordinates for given global screen coordinates

set_drag_result(result)[source]

Sets the result that should be returned to the system from the handling of the current drag operation. Valid result values are: “error”, “none”, “copy”, “move”, “link”, “cancel”. These have the meanings associated with their WX equivalents.

set_mouse_owner(mouse_owner, transform=None, history=None)[source]

Handle the ‘mouse_owner’ being changed

Parameters
  • mouse_owner (Component or None) – The new “mouse owner” component. This component will receive all key and mouse events until a new mouse owner is set.

  • transform (3x3 ndarray or None) – An affine transform which is applied to events before dispatch

  • history (list of Interactor or None) – A list of interactors which is used to build a tranform (via get_event_transform()) to be applied to events before dispatch.

set_pointer(pointer)[source]

Sets the current cursor shape.

Parameters

pointer (str) – The name of the cursor shape. Valid values are in enable.toolkit_constants.pointer_names

set_timer_interval(component, interval)[source]

Set up or cancel a timer for a specified component

set_tooltip(tooltip)[source]

Set the window’s tooltip (if necessary)

Parameters

tooltip (str) – The tooltip text.

enable.abstract_window.Alias(name)[source]