15 May 22:16
saving the clipboard on exit (editor)
From: andre arpin <arpin@...>
Subject: saving the clipboard on exit (editor)
Newsgroups: gmane.comp.lib.wxwidgets.wxlua.user
Date: 2008-05-15 20:19:16 GMT
Subject: saving the clipboard on exit (editor)
Newsgroups: gmane.comp.lib.wxwidgets.wxlua.user
Date: 2008-05-15 20:19:16 GMT
Adding this code to CloseWindow will save the text in the clipboard to the
global clipboard.
local clipBoard = wx.wxClipboard.Get()
local editor = GetEditor()
if editor:CanPaste() and clipBoard and clipBoard:Open() then
-- We are pasting into the current document but it will be thrown away
editor:SelectAll();
editor:Paste();
clipBoard.Get():SetData(wx.wxTextDataObject(editor.Text))
clipBoard.Get():Flush()
clipBoard.Get():Close()
end
Andre
PS: Tested only on window.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
RSS Feed