]> granicus.if.org Git - python/commitdiff
Patch #1063914: Add clipboard_get.
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 16 Apr 2006 20:55:38 +0000 (20:55 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 16 Apr 2006 20:55:38 +0000 (20:55 +0000)
Lib/lib-tk/Tkinter.py
Misc/NEWS

index 5bd7aa9d491b0646381bf69ad17821e7f404f962..303c22d96723e7e01eaeeeba3dcaacd69f06196c 100644 (file)
@@ -483,7 +483,24 @@ class Misc:
     def bell(self, displayof=0):
         """Ring a display's bell."""
         self.tk.call(('bell',) + self._displayof(displayof))
+        
     # Clipboard handling:
+    def clipboard_get(self, **kw):
+        """Retrieve data from the clipboard on window's display.
+        
+        The window keyword defaults to the root window of the Tkinter 
+        application.
+        
+        The type keyword specifies the form in which the data is 
+        to be returned and should be an atom name such as STRING 
+        or FILE_NAME.  Type defaults to STRING. 
+        
+        This command is equivalent to:
+        
+        selection_get(CLIPBOARD)
+        """
+        return self.tk.call(('clipboard', 'get') + self._options(kw))
+        
     def clipboard_clear(self, **kw):
         """Clear the data in the Tk clipboard.
 
index 0f703788c71cf80a93e827c5285ebdd567806a2d..9e547fdbcfeb258f040d595046683b5a1ee51fab 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -72,6 +72,8 @@ Extension Modules
 Library
 -------
 
+- Patch #1063914: Add Tkinter.Misc.clipboard_get().
+
 - Patch #1191700: Adjust column alignment in bdb breakpoint lists.
 
 - SimpleXMLRPCServer relied on the fcntl module, which is unavailable on