suomaf
Joined: 26 Aug 2006 Posts: 3
|
Posted: Thu Aug 31, 2006 7:40 am Post subject: treeview |
|
|
Hello all,
I am completely confused about how to use this widget. I am looking to create a navigation using a list. So far, I have got the following warning and I can't make heads or tails of it.
Another question .. what is the significance of the $column1, I don't think i defined it anywhere..
Would appreciate any help at all
Kind regards,
Suomaf
-----------------------------------
Warning: GtkTreeViewColumn::__construct() requires argument 2 to be an integer, null given in /media/fc4/home/sso/my-documents/my-phpgtk/notepad.php on line 15
Fatal error: Uncaught exception 'PhpGtkConstructException' with message 'could not construct GtkTreeViewColumn object' in notepad.php:15
Stack trace:
#0 notepad.php(15): GtkTreeViewColumn->__construct('Sign Message', Object(GtkCellRendererPixbuf), 'text', NULL)
#1 notepad.php(37): Notepad->__construct()
#2 {main}
thrown in notepad.php on line 15
<?php
class Notepad extends GtkWindow
{
function __construct()
{
parent::__construct();
$mainBox = new GtkVBox();
$treeStore = new GtkTreeStore(GdkPixbuf::gtype);
$treeview = new GtkTreeView();
$textRenderer = new GtkCellRendererPixbuf();
$textColumn = new GtkTreeViewColumn("Sign Message", $textRenderer,"text", $column1);
$signMessage01 = "Watch out for noobs!";
$listStore->append(array($signMessage01));
$treeview->append_column($textColumn);
$mainBox->pack_start($treeview);
$this->connect_simple('destroy', array($this, 'quit'));
$this->set_title('Simple Notepad');
$this->maximize();
$this->add($mainBox);
$this->show_all();
}
function quit()
{
Gtk::main_quit();
}
}
new Notepad();
Gtk::main();
?> |
|