title: Create a custom widget with PyGObject
body: <p>I am trying to create a custom widget with <strong>PyGObject</strong>. For example I want to create this <code>CustomButton</code> widget which adds an image and a label in a button (it's just for the example) :</p>
  
  <pre><code>#!/usr/bin/python
  #-*- coding: utf-8 -*
  
  from gi.repository import Gtk
  
  class ImageButton(Gtk.Widget):
  
      def __init__(self, label, image):
          Gtk.Widget.__init__(self)
  
          self.hbox = Gtk.HBox()
          self.label = Gtk.Label(label)
          self.image = Gtk.Image.new_from_stock(image, Gtk.IconSize.MENU)
  
          self.hbox.pack_start(self.image, False, False, 3)
          self.hbox.pack_start(self.label, False, False, 3)
  
          self.button = Gtk.Button()
          self.button.add(self.hbox)
  </code></pre>
  
  <p>In another file or class, I can use it like that :</p>
  
  <pre><code>button = ImageButton("My label", Gtk.STOCK_HOME)
  </code></pre>
  
  <p>But when I want to use it, I am obliged to call the <code>button</code> attribute, like this :</p>
  
  <pre><code># Connect the "clicked" event 
  button.button.connect("clicked", on_clicked_button)
  
  # Add the button in a container
  window.add(button.button)
  </code></pre>
  
  <p>It works but it is not practical. How to create a custom widget working like any other widget please :</p>
  
  <pre><code>button = ImageButton("My label", Gtk.STOCK_HOME)
  button.connect("clicked", on_clicked_button)
  window.add(button)
  </code></pre>