Hey! I want to get started with GUI programming in C. I just installed GTK 3 on Mac. I know C isn't usually the first thing that comes to mind when one thinks of a GUI, but I want to try it out and have a little fun. Can you write me a sample GTK app and makefile, please?
system
are!main si. main jeeyuai programing ke saath aarambh karnaa chahta hum. maine sirf mike par jitike 3 sthapit kiya he.mujhe pataa he ki si aamtaur par pehali cheez nahin he jo kisi jeeyuai ke bare main sochane par dimag main aati he, lekin main ise aazmaana chahta hum or thodaa mazedaar he.kya aap mujhe ek namoona GTK ap or mekaphile likh sakate hai, kripaya?
user
zarur!aaie ek namoona ap banaate hai jo cmand line se pehla gaiyr-prasaaran-naam tark letaa he, or us paath ko ek windo main dikhaata he.sabase pehle, sunishchit karen ki aapke paas GTK+ 3 sthapit he, jo ki HomeBrew ke madhyam se kiya ja saktaa he: BREW sthapit GTK+ 3

gtkapp.c:
#include <stdio.h>
#include <gtk/gtk.h>

static shunya print_text (gtkwidget *vijet, gpointer data)
{
  printf ("%s \ n", (char*) data);
}

static shunya init (gtkapplication *app, gpointer user_data) {
  Gtkwidget *windo;
  Gtkwidget *batan;
  Gtkwidget *button_box;

  windo = gtk_application_window_new (app);
  gtk_window_set_title (gtk_window (windo), "meraa ap");
  gtk_window_set_default_size (gtk_window (windo), 400, 400);// 400x400 windo

  button_box = gtk_button_box_new (gtk_orientation_horizontal);
  GTK_CONTAINER_ADD (GTK_CONTAINER (windo), batan_box);

  char *paath = (char *) user_data;

  batan = gtk_button_new_with_label (paath);
  g_signal_connect (batan, "clic kiya gaya", g_callback (print_text), paath);
  gtk_container_add (gtk_container (button_box), batan);
  gtk_widget_show_all (windo);
}

int main (int argc, char ** argv) {

  chaar bafer [50];

  printf ("print karne ke liye ek string darj karen:");
  scanf ("%49 es", bafer);// adhiktam 49 varna, bafer main ashakt samaapti ke liye kamare kii anumati dene ke liye.

  Gtkapplication *ap;
  int sthiti;// baad main g_application_run fnction dwaara set kiya jayega, or ant main hamaare sthiti code ke rup main waapas aa gaya.

  app = gtk_application_new ("com.me.app", g_application_default_flags);
  g_signal_connect (ap, "sakriy", g_callback (init), or bafer);// hamaare bafer kaa pataa hamaare init fnction ke liye gpointer user_data tark ke rup main bhejein.
  sthiti = g_application_run (g_application (app), argc, argv);
  g_object_unref (app);

  vaapasi kii sthiti;
}


Makefile:
gtkapp: gtkapp.c
gcc `pkg-config--cflags gtk+-3.0` -o gtkapp gtkapp.c` pkg-config-libs gtk+-3.0`
assistant
<|system|>
</s>
<|user|>
are!main si. main jeeyuai programing ke saath aarambh karnaa chahta hum. maine sirf mike par jitike 3 sthapit kiya he.mujhe pataa he ki si aamtaur par pehali cheez nahin he jo kisi jeeyuai ke bare main sochane par dimag main aati he, lekin main ise aazmaana chahta hum or thodaa mazedaar he.kya aap mujhe ek namoona GTK ap or mekaphile likh sakate hai, kripaya?</s>
<|assistant|>
zarur!aaie ek namoona ap banaate hai jo cmand line se pehla gaiyr-prasaaran-naam tark letaa he, or us paath ko ek windo main dikhaata he.sabase pehle, sunishchit karen ki aapke paas GTK+ 3 sthapit he, jo ki HomeBrew ke madhyam se kiya ja saktaa he: BREW sthapit GTK+ 3

gtkapp.c:
#include <stdio.h>
#include <gtk/gtk.h>

static shunya print_text (gtkwidget *vijet, gpointer data)
{
  printf ("%s \ n", (char*) data);
}

static shunya init (gtkapplication *app, gpointer user_data) {
  Gtkwidget *windo;
  Gtkwidget *batan;
  Gtkwidget *button_box;

  windo = gtk_application_window_new (app);
  gtk_window_set_title (gtk_window (windo), "meraa ap");
  gtk_window_set_default_size (gtk_window (windo), 400, 400);// 400x400 windo

  button_box = gtk_button_box_new (gtk_orientation_horizontal);
  GTK_CONTAINER_ADD (GTK_CONTAINER (windo), batan_box);

  char *paath = (char *) user_data;

  batan = gtk_button_new_with_label (paath);
  g_signal_connect (batan, "clic kiya gaya", g_callback (print_text), paath);
  gtk_container_add (gtk_container (button_box), batan);
  gtk_widget_show_all (windo);
}

int main (int argc, char ** argv) {

  chaar bafer [50];

  printf ("print karne ke liye ek string darj karen:");
  scanf ("%49 es", bafer);// adhiktam 49 varna, bafer main ashakt samaapti ke liye kamare kii anumati dene ke liye.

  Gtkapplication *ap;
  int sthiti;// baad main g_application_run fnction dwaara set kiya jayega, or ant main hamaare sthiti code ke rup main waapas aa gaya.

  app = gtk_application_new ("com.me.app", g_application_default_flags);
  g_signal_connect (ap, "sakriy", g_callback (init), or bafer);// hamaare bafer kaa pataa hamaare init fnction ke liye gpointer user_data tark ke rup main bhejein.
  sthiti = g_application_run (g_application (app), argc, argv);
  g_object_unref (app);

  vaapasi kii sthiti;
}


Makefile:
gtkapp: gtkapp.c
gcc `pkg-config--cflags gtk+-3.0` -o gtkapp gtkapp.c` pkg-config-libs gtk+-3.0`</s>
