title: How to change the "file" property of a GtkImage when application is running
body: <p>I want to change the image on GtkImage when user click a buttion, so I tried the code below, but it doesn't work.</p>
  
  <pre><code>/*
   * Compile me with:
   *   gcc -o tut tut.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0)
   */
  
  #include &lt;gtk/gtk.h&gt;
  
  
  G_MODULE_EXPORT gboolean on_button1_clicked(
                  GtkWidget      *event_box,
                              GdkEventButton *event,
                              gpointer     data)
  {
      GtkImage *image;
      image = GTK_IMAGE(data);
      g_return_val_if_fail(image, FALSE);
  
      g_object_set(image, "file","/home/2.png", NULL);
      g_print ("Event box clicked at coordinates %f,%f\n",
               event-&gt;x, event-&gt;y);
      /* Returning TRUE means we handled the event, so the signal
       * emission should be stopped (don't call any further
       * callbacks that may be connected). Return FALSE
       * to continue invoking callbacks.
       */
      return TRUE;
  }
  int
  main( int    argc,
        char **argv )
  {
      GtkBuilder *builder;
      GtkWidget  *window;
      GtkWidget  *image;
      GError     *error = NULL;
  
      /* Init GTK+ */
      gtk_init( &amp;argc, &amp;argv );
  
  
      /* Create new GtkBuilder object */
      builder = gtk_builder_new();
      /* Load UI from file. If error occurs, report it and quit application.
       * Replace "tut.&lt;b style="color:black;background-color:#ffff66"&gt;glade&lt;/b&gt;" with your saved project. */
      if( ! gtk_builder_add_from_file( builder, "tut_3.xml", &amp;error ) )
      {
          g_warning( "%s", error-&gt;message );
          g_free( error );
          return( 1 );
      }
  
      /* Get main window pointer from UI */
      GtkImage image = GTK_WIDGET(gtk_builder_get_object(builder, "image1"));
  
      /* Connect signals */
      gtk_builder_connect_signals( builder, data-&gt;image);
  
      /* Destroy builder, since we don't need it anymore */
      g_object_unref( G_OBJECT( builder ) );
  
      /* Show window. All other widgets are automatically shown by GtkBuilder */
      gtk_widget_show( data-&gt;window );
  
      /* Start main loop */
      gtk_main();
  
      return( 0 );
  }
  </code></pre>