Micah, Thank you for your reply. I used one button as you told me, and toggling the buttons between Start/Stop is OK.
But there's a small problem. I need the callback function to know which button got clicked, in order to take other action in the program. Here is my code:
Code:
void click_callback( GtkWidget *button, gpointer data )
{
g_print ("Hello again - %s was pressed\n", (char *) data);
gtk_button_set_label(GTK_BUTTON(button), "STOP");
}
Code:
for(z=1; z <= 15; z++)
{
sprintf(name,"%d",z);
button = gtk_button_new_with_label("Start");
gtk_signal_connect( GTK_OBJECT(button), "clicked",GTK_SIGNAL_FUNC (click_callback), (gpointer) name );
}
Now the problem is: I always get "15" as the output of g_print. I think it's a problem with the signals overwriting each other or something... Please advise.
Best Regards
Ahmed[/code]