(no subject)
- From: "samuel.berthelot" <samuel berthelot voila fr>
- To: gtk-app-devel-list gnome org
- Subject: (no subject)
- Date: Sun, 30 Nov 2003 12:51:41 +0100 (CET)
Hi,
I'm having troubles with GTK1.2 and radio buttons.
Here is my code :
rbutStyle = gtk_radio_button_new_with_label (NULL, "Points")
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rbutStyle), TRUE );
gtk_widget_show (rbutStyle);
gtk_box_pack_start (GTK_BOX (vbox8), rbutStyle, FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(rbutStyle),"toggled",
GTK_SIGNAL_FUNC(display_style),"v");
rbutStyle_group = gtk_radio_button_group (GTK_TOGGLE_BUTTON (rbutStyle))
;
rbutStyle = gtk_radio_button_new_with_label (rbutStyle_group,
"WireFrame");
gtk_widget_show (rbutStyle);
gtk_box_pack_start (GTK_BOX (vbox8), rbutStyle, FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(rbutStyle),"toggled",
GTK_SIGNAL_FUNC(display_style),"w");
rbutStyle = gtk_radio_button_new_with_label (gtk_radio_button_group
(GTK_RADIO_BUTTON (rbutStyle)), "Polygons");
gtk_widget_show (rbutStyle);
gtk_box_pack_start (GTK_BOX (vbox8), rbutStyle, FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(rbutStyle),"toggled",
GTK_SIGNAL_FUNC(display_style),"p");
The function display_style is the following :
int display_style(GtkWidget *widget, char *mode)
{
switch (mode[0]) {
case 'v':
display_mode = 'v';
break;
case 'w':
display_mode = 'w';
break;
case 'p':
display_mode= 'p';
break;
}
return (TRUE);
}
display_mode is a global variable.
I've used the debugger and found out that mode[0] is always equal to 'v'.
Why is that ?!?
Thanx
Sam
------------------------------------------
Faites un voeu et puis Voila ! www.voila.fr
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]