当前位置: 首页>>代码示例>>Python>>正文


Python DOM.setInnerText方法代码示例

本文整理汇总了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)
开发者ID:Afey,项目名称:pyjs,代码行数:27,代码来源:SVGCanvas.py

示例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)
开发者ID:Afey,项目名称:pyjs,代码行数:11,代码来源:StackPanel.py

示例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')
开发者ID:anandology,项目名称:pyjamas,代码行数:13,代码来源:DOMTest.py

示例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)
开发者ID:pombredanne,项目名称:pygwt-facebook,代码行数:15,代码来源:FbPromptPermission.py

示例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)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:19,代码来源:SVGCanvas.py

示例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)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:23,代码来源:DecoratorPanel.py

示例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)
开发者ID:Afey,项目名称:pyjs,代码行数:7,代码来源:HTMLTable.py

示例8: setText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
 def setText(self, text):
     self.clearContentPanel()
     DOM.setInnerText(self.contentElem, text)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:5,代码来源:TreeItem.py

示例9: setText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
 def setText(self, text):
     DOM.setInnerText(self.labelElem, text)
开发者ID:certik,项目名称:pyjamas,代码行数:4,代码来源:CheckBox.py

示例10: setText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
 def setText(self, text):
     DOM.setInnerText(self.getElement(), text)
开发者ID:certik,项目名称:pyjamas,代码行数:4,代码来源:__init__.py

示例11: setText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
 def setText(self, text):
     DOM.setInnerText(self.labelTD, text)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:4,代码来源:DisclosurePanel.py

示例12: setText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import setInnerText [as 别名]
 def setText(self, text):
     DOM.setInnerText(self.anchorElem, text)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:4,代码来源:Hyperlink.py


注:本文中的pyjamas.DOM.setInnerText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。