/** * Define the direction of the CheckButtons * @param $direction A string 'vertical' or 'horizontal' */ public function setLayout($layout = 'horizontal') { 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)) { $this->addItems($this->items); } }