Re: Enable drag and drop for treeview?
- From: Jef Driesen <jefdriesen hotmail com>
- To: gtkmm-list gnome org
- Subject: Re: Enable drag and drop for treeview?
- Date: Fri, 04 May 2007 09:20:12 +0200
Paul Davis wrote:
On 5/2/07, Jef Driesen <jefdriesen hotmail com> wrote:
For my application, I want to be able to re-order rows in a treeview
(treestore model) using drag and drop. According to the gtkmm book, I
can use set_reorderable(). But how can I detect when a drag and drop
operation is finished (to update the underlying database)? I can't find
any signals to connect to. Am I missing something?
I think to do this, you have to subclass Gtk::TreeModel and override
Gtk::TreeDragDest::drag_data_received_vfunc()
I did something similar here:
http://trac.lsdcas.engineering.uiowa.edu/browser/trunk/cas2/plugins/viewer/event_analysis/treemodel.hh
http://trac.lsdcas.engineering.uiowa.edu/browser/trunk/cas2/plugins/viewer/event_analysis/treemodel.cc
There's also an example in the book about doing this stuff which is
what I based my implementation on:
http://www.gtkmm.org/docs/gtkmm-2.4/examples/book/treeview/drag_and_drop/
Does this method also work well with a sorted treemodel? Because the
simple set_reorderable() does not seem to work in that case. Once the
model is sorted (by clicking on a treeview column header), drag and drop
is not possible anymore.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]