Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G


Jump to: navigation, search

Nasal library/clipboard

877 bytes added, 18:57, 26 April 2018
getText(): Doc
== Functions ==
=== getText() ===
{{Nasal doc
|syntax = clipboard.getText([type]);
|source = {{simgear file|simgear/nasal/mathlib.c|l=196|t=Source}}
|text = Returns the contents of the clipboard as a string.
|param1 = type
|param1text = Optional argument that specifies the source of the text. If <code>clipboard.CLIPBOARD</code> (the default) is given, the contents of the clipboard are returned. If <code>clipboard.SELECTION</code> is given, the contents of the selection buffer are given. Note that only X11 systems properly implement <code>clipboard.SELECTION</code>, but this argument may still be used with [[#setText()|setText]] (see example 2).
|example1 = var text = clipboard.getText(); # make sure you copy some text first
print("'", text, "'");
|example2 = clipboard.setText("Demo", clipboard.SELECTION);
var text = clipboard.getText(clipboard.SELECTION);
print("'", text, "'"); # prints 'Demo'
=== setText() ===

Navigation menu