After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 609000 - Treeviews with gtk.CellRendererToggle can't be reordered.
Treeviews with gtk.CellRendererToggle can't be reordered.
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2010-02-04 16:23 UTC by Pietro Battiston
Modified: 2018-02-10 03:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pietro Battiston 2010-02-04 16:23:49 UTC
The following code reproduces the problem:

import gtk
class ListDisp:
    def __init__(self): 
        self.w = gtk.Dialog()
        self.store=gtk.ListStore('gboolean',str)
        self.view=gtk.TreeView()
        self.w.vbox.add(self.view)
        self.view.set_model(self.store)
        self.tvcolumn = gtk.TreeViewColumn('File Name')
        self.view.append_column(self.tvcolumn)
        self.cell = gtk.CellRendererText()
        self.toggle=gtk.CellRendererToggle() 
        self.tvcolumn.pack_start(self.cell, True)
        self.tvcolumn.pack_start(self.toggle, True)
        self.tvcolumn.add_attribute(self.cell, 'text', 1)
        self.view.set_reorderable(True)
        self.store.append([True,"foo"])
        self.store.append([True,"goo"])

if __name__ == "__main__":
    ld=ListDisp()
    ld.w.show_all()
    ld.w.run()


rows can't be reordered via drag and drop; if you comment the line "        self.tvcolumn.pack_start(self.toggle, True)", then they can.
Comment 1 Pietro Battiston 2010-02-04 16:25:49 UTC
I forgot to mention that the fact that it is a gtk+ bug is a gues: I don't think it was introduced by pygtk bindings, but I didn't test in a C program.
Comment 2 Dieter Verfaillie 2011-09-19 10:45:39 UTC
Looks like it is indeed specific to CellRendererToggle. When I put
the toggle in a second TreeViewColumn, DnD functions correctly
for the first column:

import gtk

class ListDisp(gtk.Window):
    def __init__(self): 
        gtk.Window.__init__(self)
        
        self.vbox = gtk.VBox()
        self.add(self.vbox)

        self.store=gtk.ListStore('gboolean',str)
        self.store.append([True,"foo"])
        self.store.append([True,"goo"])

        self.view=gtk.TreeView(self.store)
        self.view.set_reorderable(True)

        self.tvcolumn = gtk.TreeViewColumn('File Name')
        self.view.append_column(self.tvcolumn)
        self.cell = gtk.CellRendererText()
        self.tvcolumn.pack_start(self.cell, True)
        self.tvcolumn.add_attribute(self.cell, 'text', 1)

        self.tvcolumn2 = gtk.TreeViewColumn('Toggle')
        self.view.append_column(self.tvcolumn2)
        self.toggle=gtk.CellRendererToggle() 
        self.tvcolumn2.pack_start(self.toggle, True)

        self.vbox.pack_start(self.view)
        self.show_all()


if __name__ == "__main__":
    ld=ListDisp()
    gtk.main()
Comment 3 Matthias Clasen 2018-02-10 03:27:56 UTC
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and
still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue
for it.