Revision
86
Author
leonpegg
Date
2007-01-05 05:39:52 -0800 (Fri, 05 Jan 2007)

Log Message

Callicore Ide File Drag load support added

Modified Paths

Diff

Modified: trunk/programs/ide/lib/ide_notebook.class.php (85 => 86)


--- trunk/programs/ide/lib/ide_notebook.class.php	2007-01-05 13:10:28 UTC (rev 85)
+++ trunk/programs/ide/lib/ide_notebook.class.php	2007-01-05 13:39:52 UTC (rev 86)
@@ -9,6 +9,9 @@
 		parent::__construct();
 		$this->set_scrollable(true);
 		$this->set_tab_pos(Gtk::POS_BOTTOM);
+		
+        $this->connect('drag-data-received', array($this, 'on_drop'));
+        $this->drag_dest_set(Gtk::DEST_DEFAULT_ALL, array(array('text/uri-list', 0, 0)), Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
 	}
 
 	public function new_file(){
@@ -76,6 +79,7 @@
 			$view->set_data('tab_id',self::$count);
 			$button->connect('clicked', array($this,'tab_close'),$view);
 			$this->buffers[self::$count] = $buffer;
+			$this->show_all();
 		}
 	}
 	
@@ -121,6 +125,11 @@
 	public function run(){
 		// RUN FUNCTION NOT COMPLETE YET
 	}
+	
+	public function on_drop($widget, $context, $x, $y, $data, $info, $time){
+    	$file = explode("\r\n",$data->data);
+		$this->open_file($file[0]);
+    }
 
 }