本文整理汇总了Python中muntjac.api.Label.setHeight方法的典型用法代码示例。如果您正苦于以下问题:Python Label.setHeight方法的具体用法?Python Label.setHeight怎么用?Python Label.setHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类muntjac.api.Label
的用法示例。
在下文中一共展示了Label.setHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _add_items
# 需要导入模块: from muntjac.api import Label [as 别名]
# 或者: from muntjac.api.Label import setHeight [as 别名]
#.........这里部分代码省略.........
label = heading_text(None, text=label).control
self._add_widget(inner, label, row, col, show_labels)
if item.emphasized:
self._add_emphasis(label)
# Continue on to the next Item in the list:
continue
# Check if it is a separator:
if name == '_':
cols = columns
# See if the layout is a grid.
if row >= 0:
# Move to the start of the next row if necessary.
if col > 0:
col = 0
row += 1
# # Skip the row we are about to do.
# row += 1
# Allow for the columns.
if show_labels:
cols *= 2
for i in range(cols):
if self.horizontal:
# Add a vertical separator:
line = Panel()
line.setWidth('2px')
line.setHeight('-1px')
if row < 0:
inner.addComponent(line)
else:
inner.addComponent(line, row, i)
else:
# Add a horizontal separator:
line = Label('<hr />', Label.CONTENT_XHTML)
line.setWidth('100%') # FIXME: explicit container size
if row < 0:
inner.addComponent(line)
else:
inner.addComponent(line, i, row)
# Continue on to the next Item in the list:
continue
# Convert a blank to a 5 pixel spacer:
if name == ' ':
name = '5'
# Check if it is a spacer:
if all_digits.match( name ):
# If so, add the appropriate amount of space to the layout:
spacer = Label('')
if self.horizontal:
# Add a horizontal spacer:
spacer.setWidth(name + 'px')
else:
# Add a vertical spacer:
spacer.setHeight(name + 'px')