From: Martin v. Löwis Date: Sun, 16 Apr 2006 20:55:38 +0000 (+0000) Subject: Patch #1063914: Add clipboard_get. X-Git-Tag: v2.5a2~185 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0db2a989f3b861eae80959d26dae9fcdac4dde96;p=python Patch #1063914: Add clipboard_get. --- diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 5bd7aa9d49..303c22d967 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -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. diff --git a/Misc/NEWS b/Misc/NEWS index 0f703788c7..9e547fdbcf 100644 --- 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