GtkTextView::get_text() Missing First Character
| From: | someGuy | Date: | Sat, 11 Nov 2006 09:26:15 +0000 |
| Subject: | GtkTextView::get_text() Missing First Character | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-7457@lists.php.net to get a copy of this message | ||
Hi all,
I'm not sure if this is a bug, or if I'm missing something fundamental about
how GtkTextView::get_text() works. The following code should retrieve the
entire contents of the buffer and echo it to the CLI each time a key is
pressed. However, the first character never shows up.
<?php
function keyPress($textView, $event)
{
$buffer = $textView->get_buffer();
$startIter = $buffer->get_start_iter();
$endIter = $buffer->get_end_iter();
$endOffset = $endIter->get_offset();
$text = $buffer->get_text($startIter, $endIter);
echo("text: $text\n");
} // keyPress()
$clipboard = GtkClipboard::get();
$textView = new GtkTextView();
$textView->connect("key-press-event", "keyPress");
$window = new GtkWindow();
$window->add($textView);
$window->show_all();
gtk::main();
?>
Any suggestions? Perhaps it's a bug?
-Ron T.
--
View this message in context: http://www.nabble.com/GtkTextView%3A%3Aget_text%28%29-Missing-First-Character-tf2612277.html#a7290871
Sent from the Php - GTK - General mailing list archive at Nabble.com.