本文整理汇总了Python中etkdocking.DockGroup.get_nth_item方法的典型用法代码示例。如果您正苦于以下问题:Python DockGroup.get_nth_item方法的具体用法?Python DockGroup.get_nth_item怎么用?Python DockGroup.get_nth_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类etkdocking.DockGroup
的用法示例。
在下文中一共展示了DockGroup.get_nth_item方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_nth_item
# 需要导入模块: from etkdocking import DockGroup [as 别名]
# 或者: from etkdocking.DockGroup import get_nth_item [as 别名]
def test_get_nth_item(self):
dockitem1 = DockItem()
dockitem2 = DockItem()
dockgroup = DockGroup()
dockgroup.add(dockitem1)
dockgroup.add(dockitem2)
self.assertTrue(dockgroup.get_nth_item(0) is dockitem1)
self.assertTrue(dockgroup.get_nth_item(1) is dockitem2)
self.assertTrue(dockgroup.get_nth_item(2) is None)
self.assertTrue(dockgroup.get_nth_item(-1) is None)
dockitem1.destroy()
dockitem2.destroy()
dockgroup.destroy()
示例2: test_insert_item
# 需要导入模块: from etkdocking import DockGroup [as 别名]
# 或者: from etkdocking.DockGroup import get_nth_item [as 别名]
def test_insert_item(self):
dockitem1 = DockItem()
dockitem2 = DockItem()
dockitem3 = DockItem()
dockgroup = DockGroup()
dockgroup.insert_item(dockitem1, None)
dockgroup.insert_item(dockitem2, 0)
dockgroup.insert_item(dockitem3, 1)
self.assertTrue(dockgroup.get_nth_item(0) is dockitem2)
self.assertTrue(dockgroup.get_nth_item(1) is dockitem3)
self.assertTrue(dockgroup.get_nth_item(2) is dockitem1)
dockitem1.destroy()
dockitem2.destroy()
dockitem3.destroy()
dockgroup.destroy()
示例3: test_append_item
# 需要导入模块: from etkdocking import DockGroup [as 别名]
# 或者: from etkdocking.DockGroup import get_nth_item [as 别名]
def test_append_item(self):
dockitem = DockItem()
dockgroup = DockGroup()
index = dockgroup.append_item(dockitem)
self.assertTrue(index == 0)
self.assertTrue(dockgroup.get_nth_item(0) is dockitem)
dockitem.destroy()
dockgroup.destroy()
示例4: test_prepend_item
# 需要导入模块: from etkdocking import DockGroup [as 别名]
# 或者: from etkdocking.DockGroup import get_nth_item [as 别名]
def test_prepend_item(self):
dockitem1 = DockItem()
dockitem2 = DockItem()
dockgroup = DockGroup()
index1 = dockgroup.append_item(dockitem1)
index2 = dockgroup.prepend_item(dockitem2)
self.assertTrue(index1 == 0)
self.assertTrue(index2 == 0)
self.assertTrue(dockgroup.get_nth_item(0) is dockitem2)
self.assertTrue(dockgroup.get_nth_item(1) is dockitem1)
dockitem1.destroy()
dockitem2.destroy()
dockgroup.destroy()