On 2/9/22 00:29 Rob McDonald wrote:
> Is it possible to enable the end-user to copy the text from a
> fl_message to the OS clipboard?
I thought of this already but didn't do anything yet. I'm sure this
would be doable, either with a shortcut like ctrl/c or by adding a
"copy" button (as I've seen elsewhere).
> I'm not interested in making the fl_message work with drag-n-drop
> events or an application specific clipboard. When I use a fl_message
> to display an error message to my users, I'd like for them to be able
> to copy/paste that message into an email for error reporting (and
> other use cases).
Please open a GitHub issue, title maybe "[RFE] <your text here>".
> My wish is that this would be a simple behavior flag to turn on/off.
> I suspect it will involve inheriting a custom fl_message_copyable and
> implementing an event handler with some magic sauce...
There will be a way, but maybe not before the 1.4.0 release. We can also
add it later if we don't need to break the ABI.
> I have no experience with the system clipboard through FLTK, so I'm
> not sure where to start here.
If you want to copy something to the clipboard Fl::copy() is your friend
although this will not help with fl_message() unless you patch it.
https://fltk.gitlab.io/fltk/group__fl__clipboard.html#gafe46352043c48d38b090203db417c398