[pygtk] Not possible to drag-n-drop in a treeview after a set_sort_column_id
Karl Ostmo
kostmo at gmail.com
Wed Jan 28 03:04:52 WST 2009
On Tue, Jan 27, 2009 at 8:56 AM, Lionel Dricot <zeploum at gmail.com> wrote:
> Hello,
>
> 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 feature.
>
> 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,
>
> Lionel
>
>
> PS: in rev.123 this line is now in taskbrowser/treetools.py, li 19
>
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
http://faq.pygtk.org/index.py?req=show&file=faq13.049.htp
HTH,
Karl
--
Code or be coded.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090127/e5745014/attachment.htm
More information about the pygtk
mailing list