CList/CTree emit select_row for non-selectable rows




The GtkCList and GtkCTree widgets emit select_row signals even when the
user clicks on a row whose selectable flag has been set to false with
gtk_clist_set_selectable. The widgets correctly don't actually select
the widget, they only emit this signal, which makes using that signal
quite awkward if some rows are not selectable because you have to test
the selectability of the row in question manually. It looks like a bug
to me.

here's a short pygtk program to illustrate this (gnome-python-1.0.51):

from gtk import *

window = GtkWindow()
window.connect('destroy', lambda *args: mainquit())

clist = GtkCList(1, ('column',))
for i in range(10):
    clist.append(('row' + `i`,))
    clist.set_selectable(i, 0)

window.add(clist)
window.show_all()

def select_row(*args):
    print 'select_row'
clist.connect("select_row", select_row)

mainloop()


-- 
Bernhard Herzog   | Sketch, a drawing program for Unix
herzog@online.de  | http://sketch.sourceforge.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]