Changeset - b7e1d080ef64
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 12 years ago 2013-01-15 21:04:50
drewp@bigasterisk.com
ability to abort a registered drag action
Ignore-this: 281c88d9dc644c3d2ac59f5c1e67e75d
1 file changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/tkdnd.py
Show inline comments
 
@@ -72,7 +72,9 @@ def dragSourceRegister(widget,
 
                       action='copy', datatype='text/uri-list', data=''):
 
    """
 
    if the 'data' param is callable, it will be called every time to
 
    look up the current data
 
    look up the current data.
 

	
 
    If the callable returns None (or data is None to begin with), the drag
 
    """
 
    widget.tk.call('tkdnd::drag_source', 'register', widget._w)
 

	
 
@@ -82,9 +84,12 @@ def dragSourceRegister(widget,
 
    # but I don't block my tuple from getting returned (as a tcl list)
 

	
 
    def init():
 
        return (action, datatype, data() if callable(data) else data)
 
    
 
    funcId = widget._register(init, 
 
        dataValue = data() if callable(data) else data
 
        if dataValue is None:
 
            return
 
        return (action, datatype, dataValue)
 

	
 
    funcId = widget._register(init,
 
                              widget._substitute,
 
                              1 # needscleanup
 
                              )
0 comments (0 inline, 0 general)