Created
March 24, 2010 11:55
-
-
Save mecdemort/342221 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import [java.awt Toolkit] | |
[java.awt.datatransfer StringSelection DataFlavor | |
Transferable UnsupportedFlavorException]) | |
(defn clear-clipboard [] | |
(.. Toolkit | |
getDefaultToolkit | |
getSystemClipboard | |
(setContents | |
(proxy [Transferable] [] | |
(getTransferData [flavor] (throw (UnsupportedFlavorException. flavor))) | |
(getTransferDataFlavors [] (make-array DataFlavor 0)) | |
(isDataFlavorSupported [flavor] false)) | |
nil))) | |
;this should supposedly clear the clipboard but it seems to do nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment