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