After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 85813 - gtk_list_store_insert doesn't do what it says on the box
gtk_list_store_insert doesn't do what it says on the box
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2002-06-18 21:11 UTC by bugzilla-gnome
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description bugzilla-gnome 2002-06-18 21:11:45 UTC
from the API docs:
void        gtk_list_store_insert           (GtkListStore *list_store,
                                             GtkTreeIter *iter,
                                             gint position);

Creates a new row at position. iter will be changed to point to this new
row. If position is larger than the number of rows on the list, then the
new row will be appended to the list. The row will be empty before this
function is called. To fill in values, you need to call
gtk_list_store_set() or gtk_list_store_set_value().

when I do this with a value greater than the number of rows, I get:
(nnMedia:10511): Gtk-WARNING **:
gtkliststore.c:1073:gtk_list_store_insert(): position 40 is off the end of
the list

and 
    gtk_list_store_set (list, &iter,
			  NAME_STRING, gtk_entry_get_text(GTK_ENTRY(Name)) ,
			  FREQUENCY_INT, atoi(gtk_entry_get_text(GTK_ENTRY(Frequency))),
			  GROUP_STRING, gtk_entry_get_text(GTK_ENTRY(Group)),
			  INDEX_INT, atoi(gtk_entry_get_text(GTK_ENTRY(Position))),
			  -1);

doesn't do anything.

It works properly if the position is within the list.
Comment 1 Kristian Rietveld 2002-07-26 18:27:59 UTC
fixed in CVS.