[EMAIL PROTECTED] writes:

> Hello everybody,
> 
> I've been searching the lists and google about how to solve this
> problem. I can't seem to find an answhere that works for me.  I am
> making a filemanager with autocompletion in mind. When you press
> keys the selection switches to the nearest row in a clist with the
> filename/directory. The problem is that if I want to continue with
> the arrow keys the list jumps back to the focused row.

I have some old code setting the focus row in gtk 1.2:

def clist_set_focus_row(clist,row,row_count):
    if row_count == 0:
        return
    if row_count == 1:
        r = 0
    else:
        r = min((row+0.00001)/(row_count-1),1.0)
        clist.emit("scroll_vertical",SCROLL_JUMP,r)

Its a hack but works for me. In newer pygtk implementations there
seems to be a 'rows'-attribute, so you could replace the function
argument row_count with 'clist.rows'.
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to