This is weird.
When I copy something written in the wxStyledTextCtrl and paste it somewhere else, everything is fine... but when I close the application, what I just copied from the wxStyledTextCtrl gets cleared from the clipboard!
This does not happen if I copy something from somewhere else... even after closing the application, the clipboard is intact...
Only when I copy from the wxStyledTextCtrl and close the application, what I copied disappears from the clipboard.
Does anyone of you have any idea of the reason?
Thanks in advance!
The program clears my clipboard on shutdown! Topic is solved
Re: The program clears my clipboard on shutdown!
Hi,
What is your wx version and under which platform you tst the application?
Can you reproduce this with the stc sample from the wxWidgets and/or with the native SciTe sample program?
Thank you.
What is your wx version and under which platform you tst the application?
Can you reproduce this with the stc sample from the wxWidgets and/or with the native SciTe sample program?
Thank you.
Re: The program clears my clipboard on shutdown!
Try wxClipboard::Flush
https://docs.wxwidgets.org/trunk/classw ... 33f291f932
https://docs.wxwidgets.org/trunk/classw ... 33f291f932
Use the source, Luke!
Re: The program clears my clipboard on shutdown!
I'm on Windows 10, using wxWidgets version 3.1.2
I tried with
Code: Select all
wxTheClipboard->Flush();
Note that I don't use any clipboard in my code, I only use a wxStyledTextCtrl so this is the only line of code about the clipboard in the code
Re: The program clears my clipboard on shutdown!
You need to call it before you exit the application. E.g. in wxApp::OnExit or the main frame dtor.in the window constructor, but that doesn't solve the problem...
I tested this in the "stc" sample. Originally the clipboard was not persistent. After adding "wxTheClipboard->Flush();" to "App::OnExit", it was.
Use the source, Luke!
Re: The program clears my clipboard on shutdown!
That solved the problem, thank you very much!