Register widget as drop target; type may be one of text/plain, text/uri-list, text/plain;charset=UTF-8 (see the man page tkDND for details on other (platform specific) types); sequence may be one of ' ', ' ', ' ', ' ' or ' ' ; command is the
(self, widget, type=None, sequence=None, command=None, arguments=None, priority=None)
| 25 | return res |
| 26 | |
| 27 | def bindtarget(self, widget, type=None, sequence=None, command=None, arguments=None, priority=None): |
| 28 | '''Register widget as drop target; type may be one of text/plain, text/uri-list, text/plain;charset=UTF-8 |
| 29 | (see the man page tkDND for details on other (platform specific) types); |
| 30 | sequence may be one of '<Drag>', '<DragEnter>', '<DragLeave>', '<Drop>' or '<Ask>' ; |
| 31 | command is the callback associated with the specified event, argument is an optional tuple of arguments |
| 32 | that will be passed to the callback; possible arguments include: %A %a %b %C %c %D %d %L %m %T %t %W %X %x %Y %y |
| 33 | (see the tkDND man page for details); priority may be a value in the range 1 to 100 ; if there are |
| 34 | bindings for different types, the one with the priority value will be proceeded first (default: 50). |
| 35 | If command is omitted, return the current binding for type, where sequence defaults to '<Drop>'. |
| 36 | If both type and command are omitted, return a list of registered types for widget.''' |
| 37 | command = self._generate_callback(command, arguments) |
| 38 | tkcmd = self._generate_tkcommand('bindtarget', widget, type, sequence, command, priority) |
| 39 | res = self._tkroot.tk.eval(tkcmd) |
| 40 | if type == None: |
| 41 | res = res.split() |
| 42 | return res |
| 43 | |
| 44 | def clearsource(self, widget): |
| 45 | '''Unregister widget as drag source.''' |
no test coverage detected