gnope php gtk gui gnope.org  

treeview

 
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners
View previous topic :: View next topic  
Author Message
suomaf



Joined: 26 Aug 2006
Posts: 3

PostPosted: Thu Aug 31, 2006 7:40 am    Post subject: treeview Reply with quote

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();

?>
Back to top
cweiske



Joined: 08 Dec 2005
Posts: 454
Location: Leipzig/Germany

PostPosted: Thu Aug 31, 2006 10:08 am    Post subject: Reply with quote

http://php-gtk2.de/manual/en/html/gtk/gtk.gtktreeviewcolumn.constructor.html
Back to top
Display posts from previous:   
Post new topic   Reply to topic    gnope.org Forum Index -> PHP GTK2 Beginners All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Templates enhanced by DigiWiki. Hosting by Tradebit.