Example #1
0
 /**
  * Make the datagrid scrollable
  */
 public function makeScrollable()
 {
     $this->scrollable = TRUE;
     $children = parent::get_children();
     if ($children) {
         foreach ($children as $child) {
             parent::remove($child);
         }
     }
     $scroll = new GtkScrolledWindow();
     $scroll->add($this->view);
     $scroll->set_size_request(-1, $this->height);
     parent::pack_start($scroll, true, true);
     parent::pack_start($this->action_area, false, false);
     if ($this->height) {
         parent::set_size_request(-1, $this->height);
     }
 }
 public function notebook_onclick($notebook, $tab, $page)
 {
     // Remove o notebook do container
     // @since rev 1
     parent::remove($this->notebook);
     // Remove o painel
     // @since rev 1
     $this->panel->pack_end($this->notebook);
     // Muda o estilo do GtkNoteBook
     // @since rev 1
     $this->notebook->set_tab_pos(Gtk::POS_TOP);
     foreach ($this->labels as $key => $lbl) {
         // Muda o angulo do Label
         // @since rev 1
         $lbl->set_angle(0);
         // Disconecta o event click das abas
         // @since rev 1
         $lbl->parent->disconnect($this->connects[$key]);
     }
     $this->connects = array();
     // Percorre os widgets filhos
     // @since rev 1
     foreach ($this->containers as $key => $container) {
         // Remove o widget de dentro da aba
         // @since rev 1
         $container->remove($container->get_child());
         // Adiciona um GtkFixed à aba
         // @since rev 1
         $container->add($this->abas[$key]);
     }
     // Adiciona o painel todo ao container
     // @since rev 1
     parent::pack_start($this->panel, TRUE, TRUE);
     // Seleciona a aba clicada
     // @since rev 1
     $this->notebook->set_current_page($page);
 }