Re: Removing a radiobutton from a group?



On Thu, 2003-08-21 at 03:55, Jacob Kolding wrote:
First I'd like to thank everyone for their swift replies to my last
post.

Now I have another problem. In my app I need to dynamicly add and remove
radiobuttons to/from a group.

for adding I do:

  gtk_radio_button_set_group (GTK_RADIO_BUTTON (radiobutton),
radiobutton_group);
  radiobutton_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON
(radiobutton));

and for removing:

radiobutton_group = g_slist_remove(radiobutton_group, radiobutton);

The problem is that after I've deleted a radiobutton i get at segfault
in gtk_radio_button_set_group when trying to add at new radiobutton.

Does anyone know what I'm doing wrong?

You are modifying internal data structures without updating everything
that needs to be updated. Try 
gtk_radio_button_set_group (radiobutton, NULL);

Regards,
                                                Owen





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