/**
  * Define the direction of the CheckButtons
  * @param $direction A string 'vertical' or 'horizontal'
  */
 public function setLayout($layout = 'horizontal')
 {
     $this->layout = $layout;
     parent::remove($this->widget);
     if ($layout == 'horizontal') {
         $this->widget = new GtkHBox(FALSE, 0);
     } else {
         $this->widget = new GtkVBox(FALSE, 0);
     }
     parent::add($this->widget);
     // keep items even removing the container
     if (is_array($this->items)) {
         $value = $this->getValue();
         $this->addItems($this->items);
         $this->setValue($value);
     }
 }