本文整理汇总了Python中HTML.HTML.setWordWrap方法的典型用法代码示例。如果您正苦于以下问题:Python HTML.setWordWrap方法的具体用法?Python HTML.setWordWrap怎么用?Python HTML.setWordWrap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML.HTML
的用法示例。
在下文中一共展示了HTML.setWordWrap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: insertTab
# 需要导入模块: from HTML import HTML [as 别名]
# 或者: from HTML.HTML import setWordWrap [as 别名]
def insertTab(self, text, asHTML, beforeIndex=None):
""" 1st arg can, instead of being 'text', be a widget.
1st arg can also be None, which results in a blank
space between tabs. Use this to push subsequent
tabs out to the right hand end of the TabBar.
(the "blank" tab, by not being focussable, is not
clickable).
"""
if beforeIndex is None:
beforeIndex = asHTML
asHTML = False
if (beforeIndex < 0) or (beforeIndex > self.getTabCount()):
#throw new IndexOutOfBoundsException();
pass
if text is None:
text = HTML(" ", True)
text.setWidth("100%")
text.setStyleName("gwt-TabBarRest")
self.panel.insert(text, beforeIndex + 1)
self.panel.setCellWidth(text, "100%")
return
try:
istext = isinstance(text, str) or isinstance(text, unicode)
except:
istext = isinstance(text, str)
if istext:
if asHTML:
item = HTML(text)
else:
item = Label(text)
item.setWordWrap(False)
else:
# passing in a widget, it's expected to have its own style
item = text
self.insertTabWidget(item, beforeIndex)
示例2: insertTab
# 需要导入模块: from HTML import HTML [as 别名]
# 或者: from HTML.HTML import setWordWrap [as 别名]
def insertTab(self, text, asHTML, beforeIndex=None):
""" 1st arg can, instead of being 'text', be a widget
"""
if beforeIndex is None:
beforeIndex = asHTML
asHTML = False
if (beforeIndex < 0) or (beforeIndex > self.getTabCount()):
#throw new IndexOutOfBoundsException();
pass
if isinstance(text, str):
if asHTML:
item = HTML(text)
else:
item = Label(text)
item.setWordWrap(False)
else:
# passing in a widget, it's expected to have its own style
item = text
self.insertTabWidget(item, beforeIndex)