php-gtk2 php5 question GtkTextBuffer => GtkTextView (xmlconverter.glade)
| From: | PPK-Webprogramm CH Gordevio www.ciz.ch | Date: | Mon, 24 Oct 2005 19:44:46 +0000 |
| Subject: | php-gtk2 php5 question GtkTextBuffer => GtkTextView (xmlconverter.glade) | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-1922@lists.php.net to get a copy of this message | ||
Hi all,
I test to insert xml text in to a <widget class="GtkTextView" id="textbox">
but not work my function ... How to find moor example from php-gtk2.dll <http://ciz.ch/svnciz/new_php_gtk2/php-gtk2.dll> or how-to from php-gtk2
gtk1 work so $textbox->insert(null, null, null, $buffer); but gtk2 not work...
full source:
http://ciz.ch/svnciz/new_php_gtk2/xmleditor/xmlconverter.php
http://ciz.ch/svnciz/new_php_gtk2/xmleditor/ && xmlconverter.glade
full bin php5 + php-gtk2.dll <http://ciz.ch/svnciz/new_php_gtk2/php-gtk2.dll>
http://ciz.ch/svnciz/new_php_gtk2/
best regards peter www.ciz.ch
function get_file_open() {
global $filebox, $textbox;
$filename = $filebox->get_filename(); //// GtkFileChooserDialog class
Debug::Log_action('File open =>'.$filename);
$filebox->destroy(); //// GtkFileChooserDialog class
if (is_file($filename)) {
$fp = fopen($filename, "r");
while (!feof($fp)) {
$bufferFROM_XML_FILE .= fgets($fp, 1024);
}
Debug::Log_action('set buffer init .... ');
////$textbox->set_text($buffer);
$buffer0 = new GtkTextBuffer();
$textbox->set_buffer($buffer0,$bufferFROM_XML_FILE);
$textbox->set_editable(true);
////$textbox->set_cursor_visible(true);
///$textbox->add($text_view); //// put $bufferFROM_XML_FILE to $textbox :: GtkTextView ???? ////
Debug::Log_action('set buffer init end .... ');
} else {
Debug::Log_action('error is not a file!!!');
///// error gtk message box /////
}
}