Re: Do TreeIters persist after foreach search ?




On Thu, 2007-11-08 at 11:53 +0000, Dave Howorth wrote:

Any ideas what's happening, or better ways to find a node in the model?

use a Gtk2::TreePath instead, which is meant to keep pointing to a row
in the model (regardless of the fact if that row exists or if the data
has been changed):

  # inside the foreach():
  $match_path = $model->get_path($iter);

and then:

  $iter = $model->get_iter($match_path); # always check retval
  $value = $model->get($iter, $column) if defined $iter;

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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