When you want to convert an integer to char so you can pass such integer as parameter, you will do:
#include <stdio.h>
int main(void)
{
char c[4];
int i=5;
sprintf(c, "%d", i);
printf("%s %d", c, i);
return 0;
}
You use sprintf to print your integer into a char variable, and then use it. There is a function itoa that is not standard but will help you too.
itoa is used like:
itoa(c, i, 10);
edit:
Your code I think working is:
gint x=4;
char y[4];
sprintf(y, "%d", x);
gtk_entry_set_text(GTK_ENTRY(data),y);