Cut & paste

Fltk provides routines to cut and paste ASCII text (in the future this may be UTF-8) between applications. It may be possible to cut/paste non-ascii data under X by using Fl::add_handler().

void Fl::paste(Fl_Widget *receiver)

void Fl::selection(Fl_Widget *owner, const char *stuff, int len);

const char* Fl::selection();
int Fl::selection_length();

Fl_Widget *Fl::selection_owner() const;
void Fl::selection_owner(Fl_Widget *);

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.