Ensure the clipboard contents are stored properly on GTK

GTK needs to be told the data on the clipboard can be stored
before the store is attempted.

Also, document that the clipboard behavior on GTK is very
dependent on the configuration of the user's machine.

Closes #10515
This commit is contained in:
Ian McInerney
2020-07-12 00:39:33 +01:00
parent b7057c336f
commit 04ff2254a0
3 changed files with 28 additions and 3 deletions

View File

@@ -151,7 +151,8 @@ void MyFrame::OnFlush(wxCommandEvent &WXUNUSED(event))
return;
}
if ( !wxTheClipboard->AddData(new wxTextDataObject("Text from wx clipboard sample")) )
wxString clipData = wxString::Format("Text from wx clipboard sample at %s" , wxDateTime::Now().Format());
if ( !wxTheClipboard->AddData(new wxTextDataObject(clipData)) )
{
m_textctrl->AppendText("Failed to put text on clipboard.\n");
return;