Partially Resolve #15

This commit is contained in:
Timothy Warren 2012-04-12 11:32:15 -04:00
parent bd4e041e7d
commit 6bad56ad25
4 changed files with 12 additions and 8 deletions

View File

@ -83,7 +83,7 @@ class Connection_Sidebar extends GtkVBox {
// Create the treeview // Create the treeview
$this->treeview = (isset($this->treeview)) $this->treeview = (isset($this->treeview))
? $this->treeview ? $this->treeview
: new Data_Grid(); : new Data_Grid(new GTKTreeStore(Gobject::TYPE_PHP_VALUE));
$model = $this->treeview->get_model(); $model = $this->treeview->get_model();

View File

@ -26,12 +26,16 @@ class Data_Grid extends GtkTreeView {
*/ */
public function __construct($model = null) public function __construct($model = null)
{ {
$this->model = ( ! is_null($model)) if ( ! is_null($model))
? $model {
: new GtkTreeStore(Gobject::TYPE_PHP_VALUE); $this->model = $model;
parent::__construct($this->model); parent::__construct($this->model);
} }
else
{
parent::__construct();
}
}
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

View File

@ -212,7 +212,7 @@ class DB_tabs extends GTKNotebook {
*/ */
private static function _add_tab(&$conn, $tab_name, $col_name, $method, $events=array()) private static function _add_tab(&$conn, $tab_name, $col_name, $method, $events=array())
{ {
$tab = new Data_Grid(); $tab = new Data_Grid(new GTKTreeStore(Gobject::TYPE_PHP_VALUE));
$tab_model = $tab->get_model(); $tab_model = $tab->get_model();
$conn_name = $conn->conn_name; $conn_name = $conn->conn_name;