set_title("Table Data"); $this->set_position(Gtk::WIN_POS_CENTER_ALWAYS); $this->set_destroy_with_parent(TRUE); $this->win = new GTKScrolledWindow(); $this->win->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); $this->add($this->win); $this->_render($data); // Resize to a sane size $this->set_size_request(640, 480); } /** * Layout the window * * @param array $data * @return void */ protected function _render($data) { $view = new Data_Grid(); $view->render_data($data); // Add the grid to the window $this->win->add_with_viewport($view); $this->show_all(); } }