本文整理汇总了Python中pyjamas.DOM.setInnerText方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.setInnerText方法的具体用法?Python DOM.setInnerText怎么用?Python DOM.setInnerText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.DOM
的用法示例。
在下文中一共展示了DOM.setInnerText方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fillText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def fillText(self, text, startX, startY, maxWidth=None):
"""
Places text, at the specified start
coords, according to the current fillstyle.
@param startX x coord of the top left corner in the destination space
@param startY y coord of the top left corner in the destination space
@param maxWidth maximum width of text
"""
# create an SVG text element
text_elem = self._createElementSVG("text")
# integerize the coordinates
xy = self._integerize(startX, startY)
# add the size and position
DOM.setElemAttribute(text_elem, "x", str(xy[0]))
DOM.setElemAttribute(text_elem, "y", str(xy[1]))
if maxWidth is not None:
DOM.setElemAttribute(text_elem, "textLength", str(maxWidth))
# add the fill styles
style = "font:"+self.ctx["font"]+";fill:"+str(self.ctx["fill"])
DOM.setElemAttribute(text_elem, "style", style)
# now add the text
DOM.setInnerText(text_elem, text)
# add the rect element to the canvas
self._addElementSVG(text_elem)
示例2: setStackText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def setStackText(self, index, text, asHTML=False):
if index >= self.getWidgetCount():
return
td = DOM.getChild(DOM.getChild(self.body, index * 2), 0)
if asHTML:
DOM.setInnerHTML(td, text)
else:
DOM.setInnerText(td, text)
示例3: testDivText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def testDivText(self):
e = DOM.getElementById('tests')
div = DOM.createElement('div')
DOM.appendChild(e, div)
div2 = DOM.createElement('div')
DOM.appendChild(div, div2)
DOM.setInnerText(div2, 'hello world\n')
self.write_test_output('addDiv')
DOM.removeChild(e, div)
self.write_test_output('removeDiv')
示例4: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def __init__(self, text, *permission):
self.__init__._super()
"""
Prompt user for permission, one or many permissions at a time.
"""
if text == None:
raise IllegalArgumentException(u"text null")
if permission == None:
raise IllegalArgumentException(u"permission null")
super(self.__class__,self).setElement(DOM.createElement(u"fb:prompt-permission"))
super(self.__class__,self).addStyleName(u"gwittit-FbPromptPermission")
self.getElement().setAttribute(u"perms", self.permString(permission))
DOM.setInnerText(self.getElement(), text)
示例5: fillText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def fillText(self, text, startX, startY, maxWidth=None):
# create an SVG text element
text_elem = self._createElementSVG("text")
# integerize the coordinates
xy = self._integerize(startX, startY)
# add the size and position
DOM.setElemAttribute(text_elem, "x", str(xy[0]))
DOM.setElemAttribute(text_elem, "y", str(xy[1]))
if maxWidth is not None:
DOM.setElemAttribute(text_elem, "textLength", str(maxWidth))
# add the fill styles
style = "font:"+self.ctx["font"]+";fill:"+str(self.ctx["fill"])
DOM.setElemAttribute(text_elem, "style", style)
# now add the text
DOM.setInnerText(text_elem, text)
# add the rect element to the canvas
self._addElementSVG(text_elem)
示例6: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def __init__(self, title, titleStyle=None, imgStyle=None,
rowStyles=None,
containerIndex=2, titleIndex=1,
**kwargs) :
if rowStyles is None:
rowStyles = ["top", "top2", "middle", "bottom"]
if titleStyle is None:
titleStyle = "title"
DecoratorPanel.__init__(self, rowStyles, containerIndex, **kwargs)
inner = self.getCellElement(titleIndex, 1)
if imgStyle:
img = DOM.createDiv()
DOM.setAttribute(img, "className", imgStyle)
DOM.appendChild(inner, img)
tdiv = DOM.createDiv()
DOM.setAttribute(tdiv, "className", titleStyle)
DOM.setInnerText(tdiv, title)
DOM.appendChild(inner, tdiv)
示例7: setText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def setText(self, row, column, text):
self.prepareCell(row, column)
td = self.cleanCell(row, column)
if text is not None:
DOM.setInnerText(td, text)
示例8: setText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def setText(self, text):
self.clearContentPanel()
DOM.setInnerText(self.contentElem, text)
示例9: setText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def setText(self, text):
DOM.setInnerText(self.labelElem, text)
示例10: setText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def setText(self, text):
DOM.setInnerText(self.getElement(), text)
示例11: setText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def setText(self, text):
DOM.setInnerText(self.labelTD, text)
示例12: setText
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
def setText(self, text):
DOM.setInnerText(self.anchorElem, text)