gnope php gtk gui gnope.org  

Drag'n'drop with files

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
will.garcia



Joined: 28 Apr 2006
Posts: 8

PostPosted: Fri Apr 28, 2006 5:16 pm    Post subject: Drag'n'drop with files Reply with quote

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 ( Twisted Evil ) and I think a little stress after hours and hours of Glade2/Gnope/PHP-GTK2/phpGladeTool installations ( Evil or Very Mad )
Back to top
scott



Joined: 16 Feb 2006
Posts: 35

PostPosted: Fri Apr 28, 2006 6:33 pm    Post subject: Reply with quote

Take a look at PEAR::Gtk2_FileDrop.
Back to top
will.garcia



Joined: 28 Apr 2006
Posts: 8

PostPosted: Tue May 02, 2006 1:57 pm    Post subject: Reply with quote

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

PostPosted: Tue May 02, 2006 3:20 pm    Post subject: Reply with quote

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

PostPosted: Tue May 02, 2006 3:29 pm    Post subject: Reply with quote

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

PostPosted: Tue May 02, 2006 3:36 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.