MCPcopy Index your code
hub / github.com/python/cpython / selection_handle

Method selection_handle

Lib/tkinter/__init__.py:1144–1158  ·  view source on GitHub ↗

Specify a function COMMAND to call if the X selection owned by this widget is queried by another application. This function must return the contents of the selection. The function will be called with the arguments OFFSET and LENGTH which allows the chunking

(self, command, **kw)

Source from the content-addressed store, hash-verified

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
1146 selection owned by this widget is queried by another
1147 application.
1148
1149 This function must return the contents of the
1150 selection. The function will be called with the
1151 arguments OFFSET and LENGTH which allows the chunking
1152 of very long selections. The following keyword
1153 parameters can be provided:
1154 selection - name of the selection (default PRIMARY),
1155 type - type of the selection (e.g. STRING, FILE_NAME)."""
1156 name = self._register(command)
1157 self.tk.call(('selection', 'handle') + self._options(kw)
1158 + (self._w, name))
1159
1160 def selection_own(self, **kw):
1161 """Become owner of X selection.

Callers 1

__init__Method · 0.80

Calls 3

_registerMethod · 0.95
_optionsMethod · 0.95
callMethod · 0.45

Tested by

no test coverage detected