本文整理匯總了Python中HTML.HTML.setWidth方法的典型用法代碼示例。如果您正苦於以下問題:Python HTML.setWidth方法的具體用法?Python HTML.setWidth怎麽用?Python HTML.setWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTML.HTML
的用法示例。
在下文中一共展示了HTML.setWidth方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: insertTab
# 需要導入模塊: from HTML import HTML [as 別名]
# 或者: from HTML.HTML import setWidth [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)