i am developing a calculator in C using GTK+, this code activates when 3 is pressed i was wondering if it is possible to make it generic for all of my number buttons. So as the line gchar str2[] = "3"; could read whatever button was pressed in stead of just "3". I have a feeling it has something to do with accessing the label using info from the following line, could some please help me out
Code:
BTN_3 = gtk_button_new_with_mnemonic (_("3"));
Code:
void
on_BTN_3_clicked (GtkButton *button,
gpointer user_data)
{
GtkWidget *resultfld;
gchar str2[] = "3";
resultfld = GTK_ENTRY(lookup_widge(button, "entry1"));
strcat(str, str2);
gtk_entry_set_text(resultfld, str);
}