Create UI elements and connect signals.

def create_ui(self):
        '''
        Create UI elements and connect signals.
        '''
        box = Gtk.Box()
        rotate_left = Gtk.Button('Rotate left')
        rotate_right = Gtk.Button('Rotate right')
        flip_horizontal = Gtk.Button('Flip horizontal')
        flip_vertical = Gtk.Button('Flip vertical')
        reset = Gtk.Button('Reset')
        load = Gtk.Button('Load...')
        save = Gtk.Button('Save...')

        rotate_left.connect('clicked', lambda *args: self.rotate_left())
        rotate_right.connect('clicked', lambda *args: self.rotate_right())
        flip_horizontal.connect('clicked', lambda *args:
                                self.flip_horizontal())
        flip_vertical.connect('clicked', lambda *args: self.flip_vertical())
        reset.connect('clicked', lambda *args: self.reset())
        load.connect('clicked', lambda *args: GObject.idle_add(self.load))
        save.connect('clicked', lambda *args: GObject.idle_add(self.save))

        for b in (rotate_left, rotate_right, flip_horizontal, flip_vertical,
                  reset, load, save):
            box.pack_start(b, False, False, 0)

        box.show_all()
        self.widget.pack_start(box, False, False, 0)

        if self.warp_actor.parent_corners is None:
            for b in (rotate_left, rotate_right, flip_horizontal,
                      flip_vertical, reset, load, save):
                b.set_sensitive(False)
            def check_init():
                if self.warp_actor.parent_corners is not None:
                    for b in (rotate_left, rotate_right, flip_horizontal,
                              flip_vertical, reset, load, save):
                        b.set_sensitive(True)
                    return False
                return True
            GObject.timeout_add(100, check_init)