本文整理匯總了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