I have an application using STC as text-editor. User can cut/copy text and paste it to somewhere, but the text is cleared in the clipboard after my app terminates! So I'd like to know how to keep the cutted/copied text in the clipboard after the app terminates?
Hello Bruce,
I tried out, yes it behaves like that.
When you look at the demo StyledTextCtrl_1:
self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
def OnDestroy(self, evt):
# This is how the clipboard contents can be preserved after
# the app has exited.
wx.TheClipboard.Flush()
==> maybe replace former line with getting the
content of the clipboard and store this into a variable
evt.Skip()
at the end of your app, you could set the clipboard again
with wx.ClipBoard functions.
···
On Tue, 7 Jun 2005 17:51:10 +0800, "Bruce Who" <HuXuZhao@hotmail.com> wrote:
Hi,
I have an application using STC as text-editor. User can cut/copy text and paste it to somewhere,
but the text is cleared in the clipboard after my app terminates!
So I'd like to know how to keep the cutted/copied text in the clipboard after the app terminates?
I have an application using STC as text-editor. User can cut/copy
text and paste it to somewhere, but the text is cleared in the
clipboard after my app terminates! So I'd like to know how to keep
the cutted/copied text in the clipboard after the app terminates?
Use wx.TheClipboard.Flush(), but keep in mind that it could cause the
memory used by the current contents of the clipboard to never be
deallocated.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!