Re: Drag and drop from Gtk::Tree to Gtk::CList



Hi Johan, I think you have to set the data and return true in the
'drag_data_get' in order to get the 'drag_data_received' to notice the
drop. At least this is the only difference you have to my program
where I have this working.

Try 

$tree->signal_connect('drag_data_get',sub{
      my ($w,$context, $data, $info, $time) = @_;
      print "drag_data_get\n";
        $data->set($data->target, 888, 666);
        return 1;
                             });

Gavin

--
Gavin Jefferies. gavin at emptytree.com. http://emptytree.com/



Johan Ankarloo <johan ankarloo volvo com> writes:

Hi

I am trying to get drag and drop to work between a Gtk:Tree and a
Gtk::CList.

The problem that i have is that i can get the "drag_data_get" signal to
work but not the "drag_data_received" signal and it is that signal that
should trigger the actual change in the clist.

Code:
-------------------------------------------------------------------
$tree->drag_source_set('button1_mask', ['copy', 'move'],
{target=>'STRING', flags=>0, info=>0});

$tree->signal_connect('drag_data_get',sub{
      my ($w,$context, $data, $info, $time) = @_;
      print "drag_data_get\n";
                             });
$clist->drag_dest_set('all', ['copy', 'move'],{'target' => "STRING",
'flags' => 0, 'info' => 0});
$clist->signal_connect('drag_data_received',sub{
      my ($w, $context, $data, $info, $time) = @_;

      print "drag_data_received\n";
                             },$name);
-------------------------------------------------------------------


Any idea someone?

Regards

Johan Ankarloo

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]