'C programming issues, GTK assertion problem
I am posting this question because I have a problem with my beginner programming project. I am new in the use of gtk and I am blocked by a problem that I wish to expose to you. For my program to work I need to clear my store list and rewrite it, but when I run my gtk_list_store_clear(store) function my compiler displays an error of this type. enter image description here
void actualize_index_of_rep()
{
int i;
GtkTreeIter iter;
for(i=0;i<rep_size;i++)
myRep[i].index=i;
gtk_list_store_clear(store);
for(i=0;i<rep_size;i++)
{
gtk_list_store_append(store,&iter);
gtk_list_store_set(store,&iter,0,myRep[i].name,1,myRep[i].tel,2,myRep[i].index,-1);
}
return;
}
For people who want the entire code he is here enter link description here And the save file enter link description here
Thank you in advance for your time :)
Solution 1:[1]
I pulled down a copy of your program, built it, and ran it. I encountered the same issue. To be brief, after adding in some "g_printf" statements to track the process, I discovered that you had two functions called when a row is selected and the deletion button is clicked.
remove_from_prog();
remove_from_list();
When I scanned through the first function, I saw that it was saving a copy of the list out to your "save.data" file, omitting the selection that was deleted. The function then rebuilds the list and view. So, when the second function is called ("remove_from_list"), it can no longer find the row selection which then throws the error you see. The bottom line is that it appears that you do not even need the "remove_from_list" function.
Hope that helps.
Regards.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | NoDakker |
