ImageEngine/gaffer — pull request #1005 by johnhaddon (2014-09-29 15:55:33+00:00)
Title: Added accessors for the buttons on VectorDataWidget.

Here's an example config file using the new accessors to do some cheeky remapping of paths that are dropped into the PathFilter UI.

```
import GafferUI
import GafferScene

def __pathsDrop( widget, event ) :

# monkey with the data
for i in range( 0, len( event.data ) ) :
event.data[i] = "/prefix" + event.data[i]

# defer to the original drop handler
return False

def __pathsPlugWidgetCreator( plug ) :

result = GafferUI.VectorDataPlugValueWidget( plug )
result.vectorDataWidget().setDragPointer( "objects" )

# connect in front of the default drop handlers
vdw = result.vectorDataWidget()
for w in vdw, vdw.addButton(), vdw.removeButton() :
w.__dropConnection = w.dropSignal().connect( 0, __pathsDrop )

return result

GafferUI.PlugValueWidget.registerCreator(
GafferScene.PathFilter,
"paths",
__pathsPlugWidgetCreator,
)
```