本文整理汇总了Python中pyjamas.ui.TextArea.TextArea.addInputListener方法的典型用法代码示例。如果您正苦于以下问题:Python TextArea.addInputListener方法的具体用法?Python TextArea.addInputListener怎么用?Python TextArea.addInputListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.TextArea.TextArea
的用法示例。
在下文中一共展示了TextArea.addInputListener方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyjamas.ui.TextArea import TextArea [as 别名]
# 或者: from pyjamas.ui.TextArea.TextArea import addInputListener [as 别名]
def __init__(self):
Sink.__init__(self)
self.fPasswordText = PasswordTextBox()
self.fTextArea = TextArea()
self.fTextBox = TextBox()
panel = VerticalPanel()
panel.setSpacing(8)
panel.add(HTML("Normal text box:"))
panel.add(self.createTextThing(self.fTextBox))
panel.add(HTML("Password text box:"))
panel.add(self.createTextThing(self.fPasswordText))
panel.add(HTML("Text area:"))
panel.add(self.createTextThing(self.fTextArea))
panel.add(HTML("""Textarea below demos oninput event. oninput allows
to detect when the content of an element has changed. This is different
from examples above, where changes are detected only if they are made with
keyboard. oninput occurs when the content is changed through any user
interface(keyboard, mouse, etc.). For example, at first type few chars, but
then paste some text to the text areas above and below by selecting 'Paste'
command from context menu or by dragging&dropping and see the difference.
oninput is similar to onchange event, but onchange event fires only when a
text-entry widget loses focus."""))
vp = VerticalPanel()
self.echo = HTML()
textArea = TextArea()
vp.add(textArea)
vp.add(self.echo)
textArea.addInputListener(self)
panel.add(vp)
self.initWidget(panel)