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



Tim Janik wrote:
> 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);

It worked! I know that this is obvious, but with gtk+ 1.0.x it works
passing the GTK_LIST(mylist)->selection to be removed!

Thanks,
--
Claudemir Todo Bom <allgood@allgood.cx>
                   <http://www.allgood.cx>
Interests/Experiences: Linux, Networks, Netware, Programming
PGP KEY: email 'Subject: get pgp key' with *your* key on body



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