[pygtk] Not possible to drag-n-drop in a treeview after a set_sort_column_id
zeploum at gmail.com
Wed Jan 28 07:21:19 WST 2009
Thanks for the reply. Now, I can drag n drop in the treeview but, for a
completely unknown reason, the signals are not emitted anymore !
What could block row-changed and row-deleted signal ?
On Tue, Jan 27, 2009 at 7:04 PM, Karl Ostmo <kostmo at gmail.com> wrote:
> On Tue, Jan 27, 2009 at 8:56 AM, Lionel Dricot <zeploum at gmail.com> wrote:
>> I'm displaying a TreeStore in a TreeView and I want to allow the user to
>> re-organize its data by drag-n-dropping.
>> ( If you want to try, the code is available with "bzr branch lp:gtg" in
>> taskbrowser/browser.py. I will specify the line.
>> If I give you a given rev. number $X, type, after branching, "bzr revert
>> -r $X" use "./debug.sh" to launch the soft with a dummy data set )
>> In order to handle drag-n-drop, I connect to the row-changed and
>> row-deleted signal to the function that will update my datas to reflect the
>> change (rev.123,li 675)
>> It was working fine until my co-coder fixed some sorting bugs (typically,
>> we display strings but we want to sort them as integer or date).
>> Between rev. 108 and rev. 109, drag-n-dropping stopped working. The tree
>> just refuses you to drag-n-drop.
>> I've looked and found that commenting one line added during this commit
>> was causing the problem :
>> self.treestore.set_sort_column_id (2, gtk.SORT_ASCENDING (rev.109,li 113)
>> Commenting this line restore drag-n-drop. Re-enabling it break the
>> So, why such a behaviour ? I'm sure there's something I don't understand
>> about drag-n-drop and sorting. Can anyone explain to me how I can keep this
>> line and restore drag-n-drop functionnality ?
>> Thanks in advance,
>> PS: in rev.123 this line is now in taskbrowser/treetools.py, li 19
>> pygtk mailing list pygtk at daa.com.au
>> Read the PyGTK FAQ: http://faq.pygtk.org/
> Code or be coded.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pygtk