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.
(self, **kw)
| 1016 | |
| 1017 | # Clipboard handling: |
| 1018 | def clipboard_get(self, **kw): |
| 1019 | """Retrieve data from the clipboard on window's display. |
| 1020 | |
| 1021 | The window keyword defaults to the root window of the Tkinter |
| 1022 | application. |
| 1023 | |
| 1024 | The type keyword specifies the form in which the data is |
| 1025 | to be returned and should be an atom name such as STRING |
| 1026 | or FILE_NAME. Type defaults to STRING, except on X11, where the default |
| 1027 | is to try UTF8_STRING and fall back to STRING. |
| 1028 | |
| 1029 | This command is equivalent to: |
| 1030 | |
| 1031 | selection_get(CLIPBOARD) |
| 1032 | """ |
| 1033 | if 'type' not in kw and self._windowingsystem == 'x11': |
| 1034 | try: |
| 1035 | kw['type'] = 'UTF8_STRING' |
| 1036 | return self.tk.call(('clipboard', 'get') + self._options(kw)) |
| 1037 | except TclError: |
| 1038 | del kw['type'] |
| 1039 | return self.tk.call(('clipboard', 'get') + self._options(kw)) |
| 1040 | |
| 1041 | def clipboard_clear(self, **kw): |
| 1042 | """Clear the data in the Tk clipboard. |