Difference between revisions of "clipboard.addText"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(Created page with "<p>__NOTOC__ clipboard.<b>addText</b> is a function that is part of <a href=":Category:clipboard">Clipboard</a> Library. </p><p><br /> The function sets the content of the clipbo...")
 
Line 1: Line 1:
<p>__NOTOC__
+
clipboard.'''addText''' is a function that is part of the&nbsp;[[Catagory:clipboard|Clipboard]]&nbsp;Library.  
clipboard.<b>addText</b> is a function that is part of <a href=":Category:clipboard">Clipboard</a> Library.
 
</p><p><br />
 
The function sets the content of the clipboard. <br />
 
It accepts a string as input.</p><p><br />
 
<span class="fck_mw_template">{{Since|3.0}}</span>
 
</p>
 
<h2> Syntax  </h2>
 
<p>clipboard.<b>addText</b>(string)
 
</p>
 
<table class="wikitable">
 
  
<tr>
 
<th> Parameter </th><th> Description
 
</th></tr>
 
  
<tr>
 
<td> <u>string</u> </td><td> String that you want to add to clipboad
 
</td></tr>
 
</table>
 
<h2> Example  </h2>
 
  
<h2> See also  </h2>
+
The function sets the content of the clipboard. <br>  
<ul>
 
<li><a href="clipboard.setText">clipboard.setText</a></li>
 
<li><a href=":Category:clipboard">Clipboard Library</a></li>
 
</ul>
 
  
<p><br /><br />
+
It accepts a string as input.<br>
</p><a href="Category:clipboard">Clipboard Library</a>
+
 
 +
== Syntax  ==
 +
 
 +
clipboard.'''addText'''(string)
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Parameter
 +
! Description
 +
|-
 +
| <u>string</u>  
 +
| String that you want to add to clipboad
 +
|}
 +
 
 +
== Example ==
 +
 
 +
<source lang="lua">--Clipboard test
 +
 
 +
function on.paint(gc)
 +
clip = clipboard.getText()
 +
gc:drawString(clip, 100, 100)
 +
end
 +
 
 +
function on.charIn(ch)
 +
clipboard.addText(ch)
 +
platform.window:invalidate() -- recall graph engine
 +
end</source>
 +
 
 +
This code will read the content of the clipboard and print it on the screen. When you press a key, it will put the key value in the clipboard.
 +
 
 +
== See also  ==
 +
 
 +
*[[clipboard.setText|clipboard.setText]]
 +
*[[Clipboard Library|Clipboard Library]]<br>

Revision as of 09:59, 25 May 2011

clipboard.addText is a function that is part of the Clipboard Library.


The function sets the content of the clipboard.

It accepts a string as input.

Syntax

clipboard.addText(string)

Parameter Description
string String that you want to add to clipboad

Example

--Clipboard test

function on.paint(gc)
	clip = clipboard.getText()
	gc:drawString(clip, 100, 100)
end

function on.charIn(ch)
	clipboard.addText(ch)
	platform.window:invalidate() -- recall graph engine
end

This code will read the content of the clipboard and print it on the screen. When you press a key, it will put the key value in the clipboard.

See also