Return the contents of the current X selection. A keyword parameter selection specifies the name of the selection and defaults to PRIMARY. A keyword parameter displayof specifies a widget on the display to use. A keyword parameter type specifies the form of data to
(self, **kw)
| 1106 | self.tk.call(('selection', 'clear') + self._options(kw)) |
| 1107 | |
| 1108 | def selection_get(self, **kw): |
| 1109 | """Return the contents of the current X selection. |
| 1110 | |
| 1111 | A keyword parameter selection specifies the name of |
| 1112 | the selection and defaults to PRIMARY. A keyword |
| 1113 | parameter displayof specifies a widget on the display |
| 1114 | to use. A keyword parameter type specifies the form of data to be |
| 1115 | fetched, defaulting to STRING except on X11, where UTF8_STRING is tried |
| 1116 | before STRING.""" |
| 1117 | if 'displayof' not in kw: kw['displayof'] = self._w |
| 1118 | if 'type' not in kw and self._windowingsystem == 'x11': |
| 1119 | try: |
| 1120 | kw['type'] = 'UTF8_STRING' |
| 1121 | return self.tk.call(('selection', 'get') + self._options(kw)) |
| 1122 | except TclError: |
| 1123 | del kw['type'] |
| 1124 | return self.tk.call(('selection', 'get') + self._options(kw)) |
| 1125 | |
| 1126 | def selection_handle(self, command, **kw): |
| 1127 | """Specify a function COMMAND to call if the X |