/** * Define the direction of the CheckButtons * @param $direction A string 'vertical' or 'horizontal' */ public function setLayout($layout = 'horizontal') { parent::remove($this->wrapper); if ($layout == 'horizontal') { $this->wrapper = new GtkHBox(FALSE, 0); } else { $this->wrapper = new GtkVBox(FALSE, 0); } parent::add($this->wrapper); // keep items even removing the container if (is_array($this->items)) { $this->addItems($this->items); } }
/** * Class Constructor * @param $name widget's name * @param $text widget's name */ public function __construct($name, $text_name) { // executes the parent class constructor parent::__construct(); $this->text_name = $text_name; // create the combo model $this->model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING); $this->entry = new GtkEntry(); $this->entry->set_size_request(50, 25); $this->entry->set_sensitive(FALSE); $this->combo = GtkComboBox::new_text(); $this->combo->set_model($this->model); $this->combo->set_size_request(200, -1); $this->combo->connect_simple('changed', array($this, 'onComboChange')); $this->wname = $name; parent::pack_start($this->entry); parent::pack_start($this->combo); $this->validations = array(); }