An FLTK application calls Fl::paste() when it wants to receive the clipboard content.
That's usually done in a callback function. The first argument of the Fl::paste() call
identifies the receiving widget.
Then, control returns to the event loop.
At some later point, the receiving widget's handle() function will be called
with an FL_PASTE event. That function can use Fl::event_text() to get the pasted text
and Fl::event_length() to get that text's byte length. If an image is being pasted,
the value of Fl::event_clipboard() can be cast to type Fl_RGB_Image*.
The FLTK library internally does all the work of receiving a potentially large
piece of text or image. When that work is completed, FLTK generates the
FL_PASTE event and sends it to the receiving widget's handle method which
has immediate access to the entire pasted text or image.