void Fl::paste(Fl_Widget *receiver)
Set things up so the receiver widget will be called with an FL_PASTE event some time in the future. The reciever should be prepared to be called directly by this, or for it to happen later, or possibly not at all. This allows the window system to take as long as necessary to retrieve the paste buffer (or even to screw up completely) without complex and error-prone synchronization code in fltk.
void Fl::selection(Fl_Widget *owner, const char *stuff, int len);
Change the current selection. The block of text is copied to an internal buffer by Fltk (be careful if doing this in response to an FL_PASTE as this may be the same buffer returned by event_text()). The selection_owner is set to the passed owner (possibly sending FL_SELECTIONCLEAR to the previous owner).
const char* Fl::selection();
int Fl::selection_length();
Fl_Widget *Fl::selection_owner() const;
void Fl::selection_owner(Fl_Widget *);
The single-argument selection_owner(x) call can be used to move the selection to another widget or to set the owner to NULL, without changing the actual text of the selection. FL_SELECTIONCLEAR is sent to the old selection owner, if any.
Copying the buffer every time the selection is changed is obviously wasteful, especially for large selections. I expect an interface will be added in a future version to allow the selection to be made by a callback function. The current interface will be emulated on top of this.