David M. Cook wrote:

<snip>

def print_nodes(model):
   it = model.get_iter_first()
   while it:
       print model.get_value(it, 0), repr(model.get_value(it, 1))
       it = model.iter_next(it)

<snip>

One of the things I like is the support for Python mapping and iterator protocols so that the above can be:

def print_nodes(model):
   for row in model:
       print row[0], repr(row[1])

John

_______________________________________________
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