On Wed, 24 Jan 2001, Phillip Ezolt wrote:
> I would like to start searching the list from the current selection down for
> a particular piece of text.
>
> I have no way of knowing WHERE I am in the list so that I can start this
> search.
>
> I want something along the lines of:
>
> # Search from the currently selected to the end.
> for row in range(current_selection, total_number_of_rows):
> node = tree.node_nth(row)
> #If we have the text, jump to that node, and select it.
> if (tree.node_get_text(node, 3)==search_string):
> tree.select_row(row=row_number,col=-1)
> tree.moveto(row=row_number)
That would be a very slow search. Each node_nth() call would be fairly
expensive. You can traverse the tree using the parent, sibling and
children attributes of the current node you have, which should be
faster.
James.
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk