Re: Last iter on a GtkTreeView (List store)



 Jacob,

 THANKS !!! That's all I need. I did not look at the special cases -

 Thanks a lot !!,

 Harring.
--- Jacob Ilsø Christensen <firelake stofanet dk> wrote:
On Mon, 2002-09-23 at 15:59, Harring Figueiredo wrote:

  I have a list store and would like to append the row at the end.

  I could not find the func that gives me the last iterator or thenumber of
rows I have on the list.

  What is the best way to do that ?

  Thanks,

Harring.

Hi.

Well, I am no expert, but my suggestion is something like this (where
store is your GtkListStore):

To get the total number of items:

int total = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store),
NULL));

To get an iter pointing at the last one:

gtk_tree_model_iter_nth_child (GTK_TREE_MODEL (store), &iter, NULL,
total - 1);

Best regards,
Jacob.



__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



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