Getting check button children



I used erics children get procedure and it works.  but when i try to
change the state of the check button, i get into an endless loop and
then it segment faults on me.  here is the code below:

GtkWidget parent = gtk_widget_get_ancestor(widget, gtk_hbox_get_type());

i have three check boxes packed into a hbox, which i got above. then:

gtk_container_foreach(GTK_CONTAINER(parent),
	(GtkCallback) setStateFalse,
	NULL);

void setStateFalse(GtkWidget *widget, gpointer data)
{
	if(GTK_IS_TOGGLE_BUTTON(GTK_OBJECT(widget)))
		printf("toggle");
}

the above works.  it prints out three toggle messages which it should
because there are three toggle buttons.
but this one doesn't work.

void setStateFalse(GtkWidget *widget, gpointer data)
{
	if(GTK_IS_TOGGLE_BUTTON(GTK_OBJECT(widget))) {
		gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(widget),
FALSE);
	}
}

if i would stick a printf("toggle") into that, i get a lot of toggle
messages printed to the screen.  is there something wrong that i am
doing?  i need to HELP! :)

thanks in advance

Bill



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