Hi, there is a way to use the gtkhtml component with
glade / phpgtk.
In glade, create a
and add a Custom component with
gtk_html_new as creation function name.
The following php code produced a segmentation fault,
on my Debian :(
// $html is some text variable that
// contains html code
$html = "<html><body>foo</body></html>";
// generate a glade layout from
// the glade xml file
$layout = &new GladeXml("test.glade");
// retrieve the Custom component named "htmlcomponent"
$gtkhtml = &$layout->get_widget("htmlcomponent");
// gtkhtml component MUST have a content
// or the program will generate a
// segmentation fault (another one yes)
$stream = &$gtkhtml->begin();
$gtkhtml->write ($stream, $html, strlen($html) );
$gtkhtml->end ($stream, GTK_HTML_STREAM_OK);
To get rid of this segfault, I removed the
GtkViewPort widget from
the produced glade xml (I found no way to remove it from
the glade interface).
The glade file is alway usuable within glade so you can
modify the interface...
I hope this will help some coders :)
For a full list of gtkhtml callbacks and functions,
gtkhtml.h file in gtkhtml-dev packages.
NOTE : This comment was taken directly from