Re: Drag and Drop
| From: | Christian Weiske | Date: | Fri, 15 Oct 2004 18:01:37 +0000 |
| Subject: | Re: Drag and Drop | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5146@lists.php.net to get a copy of this message | ||
Hi
I'm currently writing a tutorial about using drag'n'drop from and to php-gtk applications. It should be finished sunday evening, but here is some sample code.
PS: The doc is currently not really helpful regarding this topic. But this will have changed until sunday :)
<?php
if( !extension_loaded('gtk')) {
dl( 'php_gtk.' . PHP_SHLIB_SUFFIX);
}
function dnd_drag_data_received( $widget, $context, $x, $y, $data, $info, $time)
{
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
var_dump( $data->data);} $window = &new GtkWindow(); $window->set_default_size(100, 100); $window->connect_object('destroy', array('gtk', 'main_quit')); $button = &new GtkButton('To'); $window->add($button); $button->show(); $button->realize(); $button->connect('drag-data-received', 'dnd_drag_data_received'); $targets = array( array( 'text/uri-list', 0, -1)); $button->drag_dest_set(GTK_DEST_DEFAULT_ALL, $targets, GDK_ACTION_COPY | GDK_ACTION_MOVE); $window->realize(); $window->show(); gtk::main(); ?> Regards/MfG, Christian Weiske -- XMMS is playing now: Sylver - Secrets
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc