|
Re: TreeItem Drag and Drop...: msg#00130gnome.gtk+.perl
Derek Wueppelmann wrote: > > I know I keep bringing this up, but it really bothers me. However before > I send in a bug report I just wanted to verify that this is indeed a > bug. Here is the behaviour I'm experienceing and what I was expecting. > > When creating a straight Gtk::Tree I add several Gtk::TreeItems to it. > Each of which has had the $tree->drag_dest_set method called with the > approriate items. And the signal_connect method so that when the event > of drag_data_recieved occurs, a method will be invoked. > > The thing is that this seems to work for only the root TreeItem. Any > other TreeItems that this is used for don't work at all. So I can only > drag and drop to the root item. This seems to be a bug since I've seen > programs written in c or c++ that are using Gtk::Tree's that seem to > work perfectly fine. Could I be doing something wrong? Hi, I haven't tried any of this but AFAIK Gtk::List has been deprecated for a long time and GtkCList is preferred. Of course all this changes with gtk2 and you should use a GtkTreeView instead. I did see a post that suggests an anonymous sub to use as a signal handler for the tree to get drag and drop to work from a Tree to a CList: $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; }); and also a way to work out which node the drop happened on: sub treeDragDataReceived { my $browser = shift; my $tree = shift; my ($context, $x, $y, $data, $info, $time) = @_; (my $row, my $col) = $tree->get_selection_info($x, $y); my $treenode = $tree->node_nth($row); return 1 if (!$treenode); .... HTH, Dermot |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: gtk_widget_set_name: 00130, Dermot Musgrove |
|---|---|
| Next by Date: | gtk widget events (was: gtk_widget_set_name): 00130, Riswick, J.G.A. van |
| Previous by Thread: | TreeItem Drag and Drop...i: 00130, Derek Wueppelmann |
| Next by Thread: | Re: TreeItem Drag and Drop...: 00130, Derek Wueppelmann |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |