本文整理汇总了Python中pyjamas.ui.VerticalPanel.VerticalPanel.setVerticalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel.setVerticalAlignment方法的具体用法?Python VerticalPanel.setVerticalAlignment怎么用?Python VerticalPanel.setVerticalAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.VerticalPanel.VerticalPanel
的用法示例。
在下文中一共展示了VerticalPanel.setVerticalAlignment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setVerticalAlignment [as 别名]
def __init__(self):
SimplePanel.__init__(self)
panel = VerticalPanel()
panel.setBorderWidth(1)
panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
part1 = Label("Part 1")
part2 = Label("Part 2")
part3 = Label("Part 3")
part4 = Label("Part 4")
panel.add(part1)
panel.add(part2)
panel.add(part3)
panel.add(part4)
panel.setCellHeight(part1, "10%")
panel.setCellHeight(part2, "70%")
panel.setCellHeight(part3, "10%")
panel.setCellHeight(part4, "10%")
panel.setCellHorizontalAlignment(part3, HasAlignment.ALIGN_RIGHT)
panel.setWidth("50%")
panel.setHeight("300px")
self.add(panel)
示例2: createImage
# 需要导入模块: from pyjamas.ui.VerticalPanel import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel.VerticalPanel import setVerticalAlignment [as 别名]
def createImage(self, imageUrl):
image = Image(imageUrl)
image.setStyleName("ks-images-Image")
p = VerticalPanel()
p.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
p.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
p.add(image)
return p