digitalmars.D.learn - How to put an arbitrary string to clipboard in D?
- tastyminerals (4/4) Jul 30 2021 I made a GUI app using tkd library. I am reading the string from
- rikki cattermole (4/7) Jul 30 2021 copyText on a Text widget appears to do what you want.
- tastyminerals (5/13) Jul 31 2021 The problem is that I don't use Text widget but retrieve the
- rikki cattermole (3/5) Jul 31 2021 No, this requires a windowing library and yes a window to do it
- Adam D Ruppe (9/11) Jul 31 2021 You can always call the same system functions from D that you'd
I made a GUI app using tkd library. I am reading the string from one of the app widgets and would like to put it into the clipboard. Does anyone have an idea how to copy a string to the clipboard in D?
Jul 30 2021
On 31/07/2021 7:33 AM, tastyminerals wrote:I made a GUI app using tkd library. I am reading the string from one of the app widgets and would like to put it into the clipboard. Does anyone have an idea how to copy a string to the clipboard in D?copyText on a Text widget appears to do what you want. https://github.com/nomad-software/tkd/blob/9ca40d117649bb9a9db108d8f92e92870b9dc77e/source/tkd/widget/text.d#L477 https://wiki.tcl-lang.org/page/tk_textCopy
Jul 30 2021
On Friday, 30 July 2021 at 20:01:09 UTC, rikki cattermole wrote:On 31/07/2021 7:33 AM, tastyminerals wrote:The problem is that I don't use Text widget but retrieve the string from TreeView widget which only has getSelectedRows method. So I thought there may be a way in D to communicate with the system clipboard...I made a GUI app using tkd library. I am reading the string from one of the app widgets and would like to put it into the clipboard. Does anyone have an idea how to copy a string to the clipboard in D?copyText on a Text widget appears to do what you want. https://github.com/nomad-software/tkd/blob/9ca40d117649bb9a9db108d8f92e92870b9dc77e/source/tkd/widget/text.d#L477 https://wiki.tcl-lang.org/page/tk_textCopy
Jul 31 2021
On 01/08/2021 6:30 AM, tastyminerals wrote:So I thought there may be a way in D to communicate with the system clipboard...No, this requires a windowing library and yes a window to do it (depending on the windowing system and even the desktop environment).
Jul 31 2021
On Saturday, 31 July 2021 at 18:30:47 UTC, tastyminerals wrote:So I thought there may be a way in D to communicate with the system clipboard...You can always call the same system functions from D that you'd use from C. This is the source to my simpledisplay.d library on its clipboard function: https://github.com/adamdruppe/arsd/blob/master/simpledisplay.d#L5279 The Windows side isn't too bad, the linux side a bit more complicated. Generally window libs offer something for this but idk about the one you're using.
Jul 31 2021