GtkClipboard::set_text

void set_text(string text [, int len = -1]);

Sets the contents of the clipboard to the string specified by text. If len is given it determines the length of text to be copied. If len is not specified it defaults to -1 and the method calculates the text length.

See also: request_text()