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)
| 1124 | self.tk.call(('selection', 'clear') + self._options(kw)) |
| 1125 | |
| 1126 | def selection_get(self, **kw): |
| 1127 | """Return the contents of the current X selection. |
| 1128 | |
| 1129 | A keyword parameter selection specifies the name of |
| 1130 | the selection and defaults to PRIMARY. A keyword |
| 1131 | parameter displayof specifies a widget on the display |
| 1132 | to use. A keyword parameter type specifies the form of data to be |
| 1133 | fetched, defaulting to STRING except on X11, where UTF8_STRING is tried |
| 1134 | before STRING.""" |
| 1135 | if 'displayof' not in kw: kw['displayof'] = self._w |
| 1136 | if 'type' not in kw and self._windowingsystem == 'x11': |
| 1137 | try: |
| 1138 | kw['type'] = 'UTF8_STRING' |
| 1139 | return self.tk.call(('selection', 'get') + self._options(kw)) |
| 1140 | except TclError: |
| 1141 | del kw['type'] |
| 1142 | return self.tk.call(('selection', 'get') + self._options(kw)) |
| 1143 | |
| 1144 | def selection_handle(self, command, **kw): |
| 1145 | """Specify a function COMMAND to call if the X |