本文整理汇总了Python中transforms.Bbox.union方法的典型用法代码示例。如果您正苦于以下问题:Python Bbox.union方法的具体用法?Python Bbox.union怎么用?Python Bbox.union使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transforms.Bbox
的用法示例。
在下文中一共展示了Bbox.union方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: contains
# 需要导入模块: from transforms import Bbox [as 别名]
# 或者: from transforms.Bbox import union [as 别名]
def contains(self, mouseevent):
"""Test whether the mouse event occurred in the table.
Returns T/F, {}
"""
if callable(self._contains):
return self._contains(self, mouseevent)
# TODO: Return index of the cell containing the cursor so that the user
# doesn't have to bind to each one individually.
if self._cachedRenderer is not None:
boxes = [self._cells[pos].get_window_extent(self._cachedRenderer)
for pos in self._cells.iterkeys()
if pos[0] >= 0 and pos[1] >= 0]
bbox = Bbox.union(boxes)
return bbox.contains(mouseevent.x, mouseevent.y), {}
else:
return False, {}
示例2: get_window_extent
# 需要导入模块: from transforms import Bbox [as 别名]
# 或者: from transforms.Bbox import union [as 别名]
def get_window_extent(self, renderer):
"Return the bounding box of the table in window coords"
boxes = [cell.get_window_extent(renderer) for cell in self._cells.values()]
return Bbox.union(boxes)
示例3: get_window_extent
# 需要导入模块: from transforms import Bbox [as 别名]
# 或者: from transforms.Bbox import union [as 别名]
def get_window_extent(self, renderer):
'Return the bounding box of the table in window coords'
boxes = [c.get_window_extent(renderer) for c in self._cells]
return Bbox.union(boxes)