title: What's the difference between GtkApplication and gtk_init?
body: <p>I am now learning to use GTK+3.0 with C in Linux. After reading some tutorials and sample code, I have some questions regarding how to initialize an application. </p>
  
  <p>Here are two versions of code I have seen.</p>
  
  <pre><code>#include &lt;gtk/gtk.h&gt;
  
  static void
  activate (GtkApplication* app,
            gpointer        user_data)
  {
    GtkWidget *window;
  
    window = gtk_application_window_new (app);
    gtk_window_set_title (GTK_WINDOW (window), "Window");
    gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
    gtk_widget_show_all (window);
  }
  
  int
  main (int    argc,
        char **argv)
  {
    GtkApplication *app;
    int status;
  
    app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
    g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
    status = g_application_run (G_APPLICATION (app), argc, argv);
    g_object_unref (app);
  
    return status;
  }
  </code></pre>
  
  <p>This code used <code>gtk_application_new()</code> to init a <code>GtkApplication</code> and <code>g_application_run()</code> to start it. </p>
  
  <p>This is the second one.</p>
  
  <pre><code>#include &lt;gtk/gtk.h&gt;
  
  int main(int argc,char *argv[])
  {
    GtkWidget *window;
    gtk_init(&amp;argc,&amp;argv);
  
    window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(window),"helloworld");
    gtk_widget_show(window);
    gtk_main();
  
    return 0;
  }
  </code></pre>
  
  <p>This code used <code>gtk_init()</code> to init the application and <code>gtk_main()</code> to run it.</p>
  
  <p>However, I can't figure out the difference between them as the running result seems the same. </p>