Changes

Jump to navigation Jump to search

D2Editor:newRichText

18 bytes added, 17:27, 18 June 2012
m
Line 11: Line 11:  
== Example  ==
 
== Example  ==
   −
<source lang="lua">
+
<source lang="lua" highlight=2>
 
function on.create()
 
function on.create()
 
editor = D2Editor.newRichText()
 
editor = D2Editor.newRichText()
Line 19: Line 19:     
function on.charIn(char)
 
function on.charIn(char)
currentText = editor:getText()
+
currentText = editor:getText() or ""
 
editor:setText(currentText .. char)
 
editor:setText(currentText .. char)
 
--Add char to the editor
 
--Add char to the editor

Navigation menu