本文整理汇总了Python中enthought.chaco.api.OverlayPlotContainer.get_preferred_size方法的典型用法代码示例。如果您正苦于以下问题:Python OverlayPlotContainer.get_preferred_size方法的具体用法?Python OverlayPlotContainer.get_preferred_size怎么用?Python OverlayPlotContainer.get_preferred_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类enthought.chaco.api.OverlayPlotContainer
的用法示例。
在下文中一共展示了OverlayPlotContainer.get_preferred_size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_basics
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import get_preferred_size [as 别名]
def test_basics(self):
container = OverlayPlotContainer(resizable='', bounds=[100.0,200.0])
self.assert_tuple(container.get_preferred_size(), (100.0,200.0))
self.assertEquals(container._layout_needed, True)
container.do_layout()
self.assertEquals(container._layout_needed, False)
return
示例2: test_multiple_min_size
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import get_preferred_size [as 别名]
def test_multiple_min_size(self):
comp1 = StaticPlotComponent([200, 50])
comp2 = StaticPlotComponent([60, 300])
container = OverlayPlotContainer(resizable='hv', bounds=[30,30])
container.fit_components = "hv"
container.add(comp1, comp2)
container.do_layout()
self.assert_tuple(container.get_preferred_size(), (200,300))
self.assert_tuple(comp1.bounds, (200,50))
self.assert_tuple(comp2.bounds, (60,300))
return
示例3: test_fixed_size_component
# 需要导入模块: from enthought.chaco.api import OverlayPlotContainer [as 别名]
# 或者: from enthought.chaco.api.OverlayPlotContainer import get_preferred_size [as 别名]
def test_fixed_size_component(self):
container = OverlayPlotContainer(resizable='', bounds=[200.0,300.0])
# non-resizable component
component = PlotComponent(resizable='', position=[50.0,60.0], bounds=[100.0,110.0])
self.assertEquals(container._layout_needed, True)
container.do_layout()
container.add(component)
self.assertEquals(container._layout_needed, True)
container.do_layout()
self.assertEquals(container._layout_needed, False)
# check the results of the layout
self.assert_tuple(container.get_preferred_size(), (200.0,300.0))
self.assert_tuple(component.position, (50.0,60.0))
self.assert_tuple(component.bounds, (100.0,110.0))
return