本文整理汇总了Python中etk.docking.DockGroup.get_parent方法的典型用法代码示例。如果您正苦于以下问题:Python DockGroup.get_parent方法的具体用法?Python DockGroup.get_parent怎么用?Python DockGroup.get_parent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类etk.docking.DockGroup
的用法示例。
在下文中一共展示了DockGroup.get_parent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_placement_below
# 需要导入模块: from etk.docking import DockGroup [as 别名]
# 或者: from etk.docking.DockGroup import get_parent [as 别名]
def test_placement_below(self):
g1, g2 = DockGroup(), DockGroup()
docklayout.add_new_group_below(self.group, g1)
paned = g1.get_parent()
assert isinstance(paned, DockPaned), paned
assert self.group.get_parent() is paned
assert paned.get_nth_item(0) is self.group
assert paned.get_nth_item(1) is g1
docklayout.add_new_group_below(self.group, g2)
assert self.group.get_parent() is paned
assert g2.get_parent() is paned
assert paned.get_nth_item(0) is self.group
assert paned.get_nth_item(1) is g2
assert paned.get_nth_item(2) is g1
示例2: PlacementTest
# 需要导入模块: from etk.docking import DockGroup [as 别名]
# 或者: from etk.docking.DockGroup import get_parent [as 别名]
class PlacementTest(unittest.TestCase):
def setUp(self):
self.layout = DockLayout()
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.frame = DockFrame()
self.group = DockGroup()
self.layout.add(self.frame)
self.window.add(self.frame)
self.frame.add(self.group)
def test_placement_left(self):
g1, g2 = DockGroup(), DockGroup()
docklayout.add_new_group_left(self.group, g1)
paned = g1.get_parent()
assert isinstance(paned, DockPaned), paned
assert self.group.get_parent() is paned
assert paned.get_nth_item(0) is g1
assert paned.get_nth_item(1) is self.group
docklayout.add_new_group_left(self.group, g2)
assert self.group.get_parent() is paned
assert g2.get_parent() is paned
assert paned.get_nth_item(0) is g1
assert paned.get_nth_item(1) is g2
assert paned.get_nth_item(2) is self.group
def test_placement_right(self):
g1, g2 = DockGroup(), DockGroup()
docklayout.add_new_group_right(self.group, g1)
paned = g1.get_parent()
assert isinstance(paned, DockPaned), paned
assert self.group.get_parent() is paned
assert paned.get_nth_item(0) is self.group
assert paned.get_nth_item(1) is g1
docklayout.add_new_group_right(self.group, g2)
assert self.group.get_parent() is paned
assert g2.get_parent() is paned
assert paned.get_nth_item(0) is self.group
assert paned.get_nth_item(1) is g2
assert paned.get_nth_item(2) is g1
def test_placement_above(self):
g1, g2 = DockGroup(), DockGroup()
docklayout.add_new_group_above(self.group, g1)
paned = g1.get_parent()
assert isinstance(paned, DockPaned), paned
assert self.group.get_parent() is paned
assert paned.get_nth_item(0) is g1
assert paned.get_nth_item(1) is self.group
docklayout.add_new_group_above(self.group, g2)
assert self.group.get_parent() is paned
assert g2.get_parent() is paned
assert paned.get_nth_item(0) is g1
assert paned.get_nth_item(1) is g2
assert paned.get_nth_item(2) is self.group
def test_placement_below(self):
g1, g2 = DockGroup(), DockGroup()
docklayout.add_new_group_below(self.group, g1)
paned = g1.get_parent()
assert isinstance(paned, DockPaned), paned
assert self.group.get_parent() is paned
assert paned.get_nth_item(0) is self.group
assert paned.get_nth_item(1) is g1
docklayout.add_new_group_below(self.group, g2)
assert self.group.get_parent() is paned
assert g2.get_parent() is paned
assert paned.get_nth_item(0) is self.group
assert paned.get_nth_item(1) is g2
assert paned.get_nth_item(2) is g1