Is Drag & Drop on MS Windows broken?
- From: MICHAEL MCGINN <mmcginn rogers com>
- To: gtk-perl-list gnome org
- Subject: Is Drag & Drop on MS Windows broken?
- Date: Fri, 8 Oct 2010 07:00:26 -0700 (PDT)
I have a Linux perl/Gtk2 application which allows drag and drop from either the Linux Desktop or Nautilus to a SimpleList in my perl/Gtk2 application.
This doesn't work when I move the application to MS Windows. I'm using the current camelbox installation on MS Windows.
I've tried a number of different file types for the atom as well.
Does anyone know if this should be working?
code snippet
==========================
my $list = $glade->get_widget('file_list');
$file_list = Gtk2::SimpleList->new_from_treeview(
$list,
'List of files' => 'text');
$file_list->drag_dest_set(['all', 'drop', 'motion', 'highlight'],
['copy', 'private', 'default', 'move', 'link, 'ask']);
$file_list->signal_connect('drag-data-received', => \&receive_drag);
my $target_list = Gtk2::TargetList->();
my $atom = Gtk2::Gdk::Atom->new("text/uri-list");
$target_list->add($atom, 0, 0);
$file_list->drag_dest_set_target_list($target_list);
sub receive_drag {
my ($treeview, $context, $widget_x, $widget_y, $data, $info, $time) = @_;
my @uris = $data->get_uris;
foreach my $uri (@uris) {
push @{$file_list->{data}}, [ "$uri" ];
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]