Re: [gtk-list] gtk_list_remove_items doesn't works!



On Sat, 27 Mar 1999, Claudemir Todo Bom wrote:

> Hi people!
> 
> I'm having some trouble with gtk_list_remove_items, the line is:
> 
> gtk_list_remove_items ( GTK_LIST(mylist),GTK_LIST(mylist)->selection );

you can't pass GTK_LIST(mylist)->selection into remove_items and expect
things to work. obviously, upon removal of list items,
GTK_LIST(mylist)->selection has to be updated, this is done at the beginning
of gtk_list_remove_items() and then the list pointer you passed into the
function becomes invalid.

do this instead:

GList *copy = g_list_copy (GTK_LIST(mylist)->selection);

gtk_list_remove_items (GTK_LIST (mylist), copy);
g_list_free (copy);

---
ciaoTJ



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