title: How to update image in gtk.Button with GTK#
body: <p>Well I was working on simple application for starting/stopping and restarting my LAMP in mono (just to get knowing the GUI development with mono bit more), so to have less buttons I decided to have one button for starting and stopping the servers. In the GUI designer I added a start button with icon, the problem is that updating the button label is easy, but changing the image to Stock.MediaStop is a bit of a problem. So How to change the stock image in a button on click event (it doesn't meter on what kind of event it is actually). Here some code:
  The GUI XML for a button:</p>
  
  <pre><code>&lt;widget class="Gtk.Button" id="button1"&gt;
         &lt;property name="MemberName" /&gt;
         &lt;property name="CanFocus"&gt;True&lt;/property&gt;
         &lt;property name="Type"&gt;TextAndIcon&lt;/property&gt;
         &lt;property name="Icon"&gt;stock:gtk-media-play Menu&lt;/property&gt;
         &lt;property name="Label" translatable="yes"&gt;Start&lt;/property&gt;
         &lt;property name="UseUnderline"&gt;True&lt;/property&gt;
         &lt;signal name="Clicked" handler="OnMysqlServerStartStop" /&gt;
  &lt;/widget&gt;
  </code></pre>
  
  <p>And here how MediaDevelop made the Stock button with custom text:</p>
  
  <pre><code>// Container child hbox1.Gtk.Box+BoxChild
          this.hbuttonbox1 = new Gtk.HButtonBox();
          this.hbuttonbox1.Name = "hbuttonbox1";
          // Container child hbuttonbox1.Gtk.ButtonBox+ButtonBoxChild
          this.button1 = new Gtk.Button();
          this.button1.CanFocus = true;
          this.button1.Name = "button1";
          this.button1.UseUnderline = true;
          // Container child button1.Gtk.Container+ContainerChild
          Gtk.Alignment w2 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
          // Container child GtkAlignment.Gtk.Container+ContainerChild
          Gtk.HBox w3 = new Gtk.HBox();
          w3.Spacing = 2;
          // Container child GtkHBox.Gtk.Container+ContainerChild
          Gtk.Image w4 = new Gtk.Image();
          w4.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-media-play", Gtk.IconSize.Menu, 16);
          w3.Add(w4);
          // Container child GtkHBox.Gtk.Container+ContainerChild
          Gtk.Label w6 = new Gtk.Label();
          w6.LabelProp = Mono.Unix.Catalog.GetString("Start");
          w6.UseUnderline = true;
          w3.Add(w6);
          w2.Add(w3);
          this.button1.Add(w2);
          this.hbuttonbox1.Add(this.button1);
  </code></pre>