本文整理汇总了Python中pitivi.timeline.timeline.Timeline.createLayer方法的典型用法代码示例。如果您正苦于以下问题:Python Timeline.createLayer方法的具体用法?Python Timeline.createLayer怎么用?Python Timeline.createLayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pitivi.timeline.timeline.Timeline
的用法示例。
在下文中一共展示了Timeline.createLayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createTimeline
# 需要导入模块: from pitivi.timeline.timeline import Timeline [as 别名]
# 或者: from pitivi.timeline.timeline.Timeline import createLayer [as 别名]
def createTimeline(self, layers_heights):
project_manager = ProjectManager(app=None)
project_manager.newBlankProject()
project = project_manager.current_project
timeline = Timeline(container=None, app=None)
timeline.get_parent = mock.MagicMock()
timeline.setProject(project)
y = 0
for priority, height in enumerate(layers_heights):
bLayer = timeline.createLayer(priority=priority)
rect = Gdk.Rectangle()
rect.y = y
rect.height = height
bLayer.ui.set_allocation(rect)
y += height + SEPARATOR_HEIGHT
return timeline