Re: phpdev4&abit includes gtk
| From: | phpgtk at bc90021.net | Date: | Sat, 13 Apr 2002 08:27:43 +0000 |
| Subject: | Re: phpdev4&abit includes gtk | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1777@lists.php.net to get a copy of this message | ||
Hi all,
I have another question regarding output displays, but this time it's with a GtkCList. I have the following code:
<?
dl ('php_gtk.so');
function showclist($output_clist)
{
$output_clist->column_titles_show();
$output_clist->set_text(1,1, "hello");
$output_clist->set_text(2,2, "goodbye");
return;
}
function makemain()
{
$main_window = &new GtkWindow();
$main_window->set_default_size(640,480);
$main_window->set_title('clist_Test');
$main_window->connect_object('destroy', array('gtk', 'main_quit'));
$main_box = &new GtkVBox();
$num_columns = 7;
$output_clist = &new GtkCList($num_columns);
for ($c=0; $c<$num_columns; $c++)
{
$output_clist->set_column_title($c, "Column $c");
$output_clist->set_column_width($c, 90);
$output_clist->set_column_justification($c, GTK_JUSTIFY_CENTER);
}
$main_box->add($output_clist);
$main_window->add($main_box);
//And of course, show everyone everything... ;)
$main_window->show_all();
showclist($output_clist);
}
makemain();
Gtk::main();
?>
When I run it, it shows the CList in the box, complete with column titles (so I know that the showclist() function is being called), but it doesn't put any text in any of the cells. What am I doing wrong? (I've also tried adding the CList directly to the main window (without the GtkVBox), but that makes no difference.)
Thanks in advance!
Tom