| View previous topic :: View next topic |
| Author |
Message |
will.garcia
Joined: 28 Apr 2006 Posts: 8
|
Posted: Fri Apr 28, 2006 5:16 pm Post subject: Drag'n'drop with files |
|
|
Hi,
The "Drag'n'drop with files" tutorial in http://gtk.php.net/manual1/fr/tutorials.filednd.php is only compatible with PHP-GTK1.
Anybody know an PHP-GTK2 example of DnD use with GtkTreeView and GtkTreeStore ?
Regards,
W.GARCIA
PS : sorry to be a little direct in my question, but I am french ( ) and I think a little stress after hours and hours of Glade2/Gnope/PHP-GTK2/phpGladeTool installations ( ) |
|
| Back to top |
|
 |
scott
Joined: 16 Feb 2006 Posts: 35
|
|
| Back to top |
|
 |
will.garcia
Joined: 28 Apr 2006 Posts: 8
|
Posted: Tue May 02, 2006 1:57 pm Post subject: |
|
|
Thanks Scott,
I try the example of PHP-GTK2 Files DnD : it's a simple File DnD into a GtkEntry
(http://cvs.php.net/viewcvs.cgi/pear/Gtk2_FileDrop/examples/example.phpw?view=log)
but I get an error :
| Code: | | Call to undefined method GtkEntry::drag_dest_set() in C:\PHP-GTK2\Gtk2\FileDrop.php on line 70 |
In the line 70, I can see :
| Code: | | $widget->drag_dest_set(Gtk::DEST_DEFAULT_ALL, array(array('text/uri-list', 0, 0)), Gdk::ACTION_COPY | Gdk::ACTION_MOVE); |
where $widget is suppose to be a GtkEntry.
When I refer to documentation (http://php-gtk2.de/manual/en/html/gtk/gtk.gtkwidget.html), I can see that :
- GtkWidget has a drag_dest_set() method
- GtkEntry is a direct subclasse of GtkWidget
- GtkEntry haven't drag_dest_set() method
I don't understand the error because I haven't change any code : it is because GtkEntry don't herite of GtkWidget methods ? it's something else ?
Thanks in advance |
|
| Back to top |
|
 |
scott
Joined: 16 Feb 2006 Posts: 35
|
Posted: Tue May 02, 2006 3:20 pm Post subject: |
|
|
Hi Will,
Make sure that you are using the latest version of PHP-GTK 2. If you installed it through Gnope, you can upgrade using:
| Code: | | pear install gnope/Gnope_PHPGtk2_dll |
Once you have the latest version, it should work. |
|
| Back to top |
|
 |
squirrel
Joined: 02 May 2006 Posts: 10 Location: Switzerland
|
Posted: Tue May 02, 2006 3:29 pm Post subject: |
|
|
I encountered the same problem. To use DnD in widgets (drag_dest_set() etc.) you must upgrade to gnope version 2006-03-26.
How to upgrade is described under the following link:
http://www.gnope.org/forum/about123.html
To really check, which function is in your installed php-gtk2, use the Gnope Dev_Inspector. |
|
| Back to top |
|
 |
will.garcia
Joined: 28 Apr 2006 Posts: 8
|
Posted: Tue May 02, 2006 3:36 pm Post subject: |
|
|
Thanks a lot for help.
I've install Gnope_PHPGtk2_dll and it's ok now : I can start working !!
Regards,
W. GARCIA |
|
| Back to top |
|
 |
|