GtkPlot

[email protected] (kksou)
Newsgroups php.gtk.general
Message-ID <[email protected]>
Hi,

Would like to come out with a working example for GtkPlot.

But I got stuck when trying to create a new GtkPlot with "$plot = new
GtkPlot();"

The error message was (using the recent PHP-GTK2 beta release on windows):
"Fatal error: Class GtkPlot cannot be instantiated directly on line 16"
(sample code attached below)

From the inspector, it seems that the port of GtkPlot (in GtkExtra) to
PHP-GTK2 has been quite complete. Did I miss out anything to get this
working? At least in C, that's the way to instantiate a new GtkPlot.

Was wondering if anyone has got GtkPlot working using PHP-GTK2 beta release?

Thanks and Regards,
/kksou

<?php
$window = new GtkWindow();
$window->set_size_request(640, 480);
$window->connect_simple('destroy', array('Gtk','main_quit'));
$window->add($vbox = new GtkVBox());

$scrolled_win = new GtkScrolledWindow();
$scrolled_win->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
$vbox->pack_start($scrolled_win);

$page_width = 600;
$page_height = 400;
$canvas = new GtkPlotCanvas($page_width, $page_height, 1.0);
$scrolled_win->add_with_viewport($canvas);

$plot = new GtkPlot();

$window->show_all();
Gtk::main();

?>
-- 
View this message in context: http://www.nabble.com/GtkPlot-tf4532916.html#a12935976
Sent from the Php - GTK - General mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.