Difference between revisions of "clipboard.addText"
Jump to navigation
Jump to search
Jimbauwens (talk | contribs) (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...") |
Jimbauwens (talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | clipboard.'''addText''' is a function that is part of the [[Catagory:clipboard|Clipboard]] Library. | |
− | clipboard. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | The function sets the content of the clipboard. <br> | |
− | |||
− | |||
− | |||
− | < | ||
− | < | + | It accepts a string as input.<br> |
− | </ | + | |
+ | == 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 08: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.