//at the end of buildDialog()
$this->tree->connect( 'drag-data-received', array( &$this, 'dragDataReceived'));
// a new function
function dragDataReceived($tree, $context , $x, $y, $data , $info, $time) {
if (count($tree->selection) != 1) {
$parent = $this->ndToplevel;
} else {
$parent = $tree->selection[0];
}
$strData = $data->data;
$arData = explode("\n", $strData);
foreach ($arData as $strLine) {
$strFile = trim($strLine);
if ($strFile == '') { continue; }
$tree->insert_node($parent, null, array(basename(urldecode($strFile)), $strFile, ''), 0, null, null, null, null, false, true);
}
$tree->columns_autosize();
}
|