note 141 added to glade.gladexml.php

From: Date: Fri, 17 May 2002 12:17:14 +0000
Subject: note 141 added to glade.gladexml.php
Groups: php.gtk.webmaster 
Request: Send a blank email to php-gtk-webmaster+get-461@lists.php.net to get a copy of this message
Hi, there is a way to use the gtkhtml component with glade / phpgtk. In glade, create a ScrolledWindow and add a Custom component with "gtk_html_new" as creation function name. The following php code produce 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 ViewPort 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, refers to gtkhtml.h file in gtkhtml-dev packages. yota http://gtk.php.net/manual/en/glade.gladexml.php

« previous php.gtk.webmaster (#461) next »