enable.base module

Define a base set of constants and functions used by the remainder of the Enable package.

class enable.base.IDroppedOnHandler[source]

Bases: object

Interface for draggable objects that handle the ‘dropped_on’ event

was_dropped_on(component, event)[source]
enable.base.add_rectangles(rectangle1, rectangle2)[source]

Add two bounds or coordinate rectangles


Compute the bounding box for a set of components


Return the bounding rectangle for a list of rectangles


Convert a bounds rectangle to a coordinate rectangle


Convert a coordinates rectangle to a bounds rectangle


Convert a coordinates rectangle to a size tuple

enable.base.does_disjoint_intersect_coordinates(coordinates_list, coordinates)[source]

Return whether a rectangle intersects a disjoint set of rectangles anywhere

enable.base.intersect_bounds(bounds1, bounds2)[source]

Compute the intersection of two bounds rectangles

enable.base.intersect_coordinates(coordinates1, coordinates2)[source]

Compute the intersection of two coordinate based rectangles

enable.base.send_event_to(components, event_name, event)[source]

Send an event to a specified set of components until it is ‘handled’


Generate all of the classes (and subclasses) for a specified class

enable.base.union_bounds(bounds1, bounds2)[source]

Compute the union of two bounds rectangles

enable.base.union_coordinates(coordinates1, coordinates2)[source]

Compute the union of two coordinate based rectangles

enable.base.xy_in_bounds(x, y, bounds)[source]

Test whether a specified (x,y) point is in a specified bounds